Monday, 30 January 2012

password-less SSH login


1. cd  /home/user/.ssh

2. Using ssh-keygen create a rsa and public key
$ ssh-keygen -t rsa
The private key will save as .ssh/id_rsa.
The public key will save as .ssh/id_rsa.pub.

3. Copy the .ssh/id_rsa.pub in file .ssh/authorized_keys of the system you wish to SSH to without being prompted for a password.
$ scp id_rsa.pub root@192.168.1.2:/home/user1/.ssh

4. Add the key to the .ssh/authorized_keys.

5. Now you can login to the system without password.

No comments:

Post a Comment