Greetings all, I'm using OpenBSD 5.6 (GENERIC).
My target is to login user through my own login_ script with SSH. Everything works fine if the user exists on device. But I'm using few large remote databases and it is crazy toÂ store all the users on the device. So I see two solutions: 1. Create user if credentials are right. 2. Use some prepared user to login. ("guest" for example) As for first solution: I've done script for this but it fails for first request (I guess that 'adduser' and 'useradd' commands are powerless to create user in authentication process) and I can successfully login after reconnection. Also user creation have some restrictions to functionallity as limited symbols for username (for example I have users with ! symbol in username in my databases). Shortcut script is listed in the end of the message. Does anybody know how to resolve at least one of this problems? As for second solution: I have no idea how to implement this. As I understand I must change the username in authentication process (namely atÂ 'response' service invokation). Is it possible at all? Thanks everybody for attention. login_ script: #!/bin/sh if [ $2 == "challenge" ]; then Â Â echo value challenge "password:">&3 Â Â echo "reject challenge">&3 Â Â exit 0 fi if [ $2 == "response" ]; then Â Â dd ibs=1 count=10 of=/temp/pswd <&3 Â Â > /temp/pswd Â Â dd ibs=1 count=1 <&3 | cat >>/temp/pswd Â Â while [ `tail -c 1 /temp/pswd | cat -e` != "^@" ] Â Â do Â Â Â dd ibs=1 count=1 <&3 | cat >>/temp/pswd Â Â done Â Â read pswd </temp/pswd Â Â > /temp/pswd Â Â # There goes function invokation that accepts username Â Â # and password and exits with 0 status ifÂ user exists in one Â Â # of remote databases and 1 in other cases Â Â if [ $? == 0]; then Â Â Â id -u $3 >/dev/null 2>&1 Â Â Â if [ $? !=0 ]; then Â Â Â Â Â useradd $3 Â Â Â fi Â Â Â echo "authorize">&3 Â Â fi Â Â exit 0 fi Best Regards, Vlad Suragin