SSH password-less login

To enable password-less login using SSH to any linux server do the following. It requires you generate your own personal set of private/public key pair. Consider you have two linux machines HostA & HostB. I am trying to configure password-less login from HostA to HostB

root@HostA # ssh-keygen -t rsa

Generating public/private rsa key pair.
Enter file in which to save the key (/home/HostA/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/HostA/.ssh/id_rsa.
Your public key has been saved in /home/HostA/.ssh/id_rsa.pub.
The key fingerprint is:
f6:61:a8:27:35:cf:4c:6d:13:22:70:cf:4c:c8:a0:23 root@HostA

The command ssh-keygen -t rsa initiated the creation of the key pair.No passphrase was entered (Enter key was pressed instead).

The private key was saved in .ssh/id_rsa. This file is read-only and only for you. No one else must see the content of that file, as it is used to decrypt all correspondence encrypted with the public key.

The public key is save in .ssh/id_rsa.pub.

In this case, the content of file id_rsa.pub is

ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEArkwv9X8eTVK4F7pMlSt45pWoiakFkZMw G9BjydOJPGH0RFNAy1QqIWBGWv7vS5K2tr+EEO+F8WL2Y/jK4ZkUoQgoi+n7DWQVOHsR ijcS3LvtO+50Np4yjXYWJKh29JL6GHcp8o7+YKEyVUMB2CSDOP99eF9g5Q0d+1U2WVdB WQM= root@HostA

Its content now has to be copied to the file .ssh/authorized_keys of the system you wish to SSH to
( In this case HostB ) without being prompted for a password.
 :) 
Share and Enjoy:
  • Digg
  • Mixx
  • del.icio.us
  • StumbleUpon
  • Facebook
  • TwitThis
  • Technorati
  • Google

Leave a Reply