Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 05-13-2008, 09:26 AM   #1
Registered: Feb 2008
Posts: 95

Rep: Reputation: 15
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??
Old 05-13-2008, 10:46 AM   #2
Registered: Feb 2008
Location: Rome, Italy
Distribution: OpenSuSE 11.x, vectorlinux, slax, Sabayon
Posts: 206
Blog Entries: 2

Rep: Reputation: 44
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
Old 05-13-2008, 11:08 AM   #3
Registered: Feb 2008
Posts: 95

Original Poster
Rep: Reputation: 15
yeah i could do that, can i provide a password with that, do you got an example script to pull this one off?

Old 05-13-2008, 07:05 PM   #4
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.7, Centos 5.10
Posts: 16,651

Rep: Reputation: 2155Reputation: 2155Reputation: 2155Reputation: 2155Reputation: 2155Reputation: 2155Reputation: 2155Reputation: 2155Reputation: 2155Reputation: 2155Reputation: 2155
If you need a passwd as well, you may need the Expect tool, its designed to handle interactive stuff automatically.
Old 05-13-2008, 09:43 PM   #5
Registered: Apr 2008
Posts: 310

Rep: Reputation: 30
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto SSH-login expect script creatorrr Linux - Software 7 10-26-2011 03:09 AM
auto-login script for connecting to remote m/n by using telnet/ftp/ssh Uday123 Programming 5 10-12-2011 11:31 AM
How to enable auto login using a shell script gauravtiwari21 Linux - Security 4 10-20-2007 02:55 AM
How can I auto login to ssh server? sailershen Linux - General 1 04-17-2006 01:04 AM
ssh or telent auto login prashant_1012 Programming 1 11-22-2005 01:12 PM

All times are GMT -5. The time now is 10:05 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration