Ubuntu : Automatic login to SSH without a password
April 28, 2009 1 Comment
Here goes a tip that is useful when you make frequently ssh access to avoid having to enter the password all the time. First generate a public key from your local machine. Then copy this key to the remote machine which you want to login automaticaly. Now append you public key to the authorized_keys. It’s recommended that you remove the key file from the remote machine. Now you can do automatic login to ssh.
local$ ssh-keygen -t dsa local$ scp ~/.ssh/id_dsa.pub firstname.lastname@example.org: # Don't forget the ":" cat id_dsa.pub >> .ssh/authorized_keys remote$ rm id_dsa.pub email@example.com
After generating the public key you can do the three steps above (to append the public key in authorized_keys file) in a single command as follows: