The personal website of Philip Mather

Passwordless SSH

OpenSSH instructions
These steps were used on an OpenSSH client and server.

First, generate your OpenSSH protocol 2 rsa key (you may use -t dsa if you want to use dsa keys):
ssh-keygen -t rsa

You will be prompted for a passphrase for your private key. Although you are not required to passphrase-protect your private key, it is considered good practice to do so. Your passphrase should ideally consist of a difficult-to-guess phrase or sentence containing several symbols and/or numbers.

Append the contents of your public key to the authorized_keys file on the remote OpenSSH server:
cat ~/.ssh/id_rsa.pub | ssh remote_server "mkdir -p ~/.ssh && cat - >> ~/.ssh/authorized_keys"

If you are using the X Window System, start X with the following command:
ssh-agent startx

From a terminal or from your desktop environment (ex. GNOME, KDE), run the following command to prompt for your private key passphrase:
ssh-add

All terminals and subprocesses spawned within X will remember your private key passphrase.