contact subscribe

Using SSH without a password

This is very simple. The secret is to use the ssh-keygen command to generate a public and private key. Then place the public key on the destination drive in ~/.ssh/ and you are good to go.

On your local drive:

$ cd ~/.ssh
$ ssh-keygen -t dsa

You will be asked to confirm the creation of two files: id_dsa and id_dsa.pub. hit ENTER to confirm. You will be aked to enter a passphrase. Hit ENTER to create an empty passphrase. Note: If you do not, you will be prompted to enter this passphrase to authenticate—negating the entire point of this post.

On your remote drive, create the file ~/.ssh/authorized_keys and append the contents of id_dsa.pub to it.

Now login:

$ ssh <user>@<host>

Voila! No more passwords…