LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   ssh auto login script (https://www.linuxquestions.org/questions/linux-server-73/ssh-auto-login-script-641890/)

zerocool22 05-13-2008 09:26 AM

ssh auto login script
 
Hey, i need to login 400 users, and cause it would take quite some time loggin them in one by one by hand. I want to ask is there a script to auto login users over ssh/ or another protocol??
I have heard about keygen but then i would make to make a key for every user and that would take me forever. I only need to log them in once, so its not that i have to do it ever again.
Is this possible??

clvic 05-13-2008 10:46 AM

Do you have to log in on the same machine? You could log in as root, and then use a bash script to loop over all your users, let them execute a specific script, and then quit.
Something like:
$> for user in ( user1 user2 user3 ); do su - $user ls; done
(this will make an "ls" for all users)
Hope this helps

zerocool22 05-13-2008 11:08 AM

yeah i could do that, can i provide a password with that, do you got an example script to pull this one off?


thx

chrism01 05-13-2008 07:05 PM

If you need a passwd as well, you may need the Expect tool, its designed to handle interactive stuff automatically.

eggixyz 05-13-2008 09:43 PM

Hey There,

Have you considered host-based authentication? It's not as secure as user key-based auth, but it would let you allow all trusted users from one server to log into your other one.

Just a thought. Hope it helps :)

, Mike


All times are GMT -5. The time now is 08:43 PM.