Password-less SSH Login

Here is the procedure to establish trust relationships between Unix boxes for a particular user using SSH. it can be helpful in script file transfers and other admin activities. 

Here i am using the source server as server1 and destination server as server2 as example.

Steps:

1.Login as user whom you want to login without password on server1

2.Type: ssh-keygen -t rsa

      Note: If you do not want to be prompted, leave passphrase blank

            The default directory for SSH keyfiles is <USER_HOME_DIRECTORY>/.ssh/

4.copy the contents of <USER_HOME_DIRECTORY>/.ssh/id_rsa.pub (there should only be one line)

5.Place this line on server2,in <USER_HOME_DIRECTORY>/.ssh/authorized_keys

that's it, you should now be able to ssh/sftp/scp from server1 to server2 without being prompted for a password!


Note: Make sure, "RSAAuthentication yes" in your /etc/ssh/sshd_config file. On many Linux installations this setting is commented out in a default install


Please dont forget to leave your comments.

Share this

Related Posts

Previous
Next Post »

1 comments:

Write comments
uno
November 13, 2011 at 8:01 AM delete

Your posts are very inspiring for me, by reading your posts, I get lots of ideas to write new posts on the blog that I have. I hope your post worthwhile for others as well

Reply
avatar

What do you think about this Article? Add your Opinion..! EmoticonEmoticon