Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ssh autologin?

Status
Not open for further replies.

venkman

Programmer
Oct 9, 2001
467
US
Is there a way to setup auto login for a server in ssh. ie.
if I do:
ssh server

then it lookup in a config file (similar to .netrc for ftp) that I like to use the username "venkman" and password "god" for this server, and login with this user and password automatically?
-Venkman
 
I suppose you could (not sure of the easiest way)

However, doing so would also represent a self inflicted security issue.

anybody who gets/has accssess to your account/login, will have access to those ssh profiles

* not recommended
 
Copy contents of client's ~username/.ssh/id_dsa.pub to server's ~username/.ssh/authorized_keys2. If you don't have the first one, create it with 'ssh-keygen -t dsa'. If you don't have the second one, just mkdir/vi. Check for proper chmod/chown, it is mandatory.
 
To expand on pupu's post, what you want to do is use authorization keys to use instead of passwords... You can password protect the key, so you'll need to auth once to a local auth server (for the current shell/process) or you can leave the password blank... I've heard of people using this latter method to automate ssh logins for cron jobs, etc..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top