How to set up a passwordless OpenSSH connection

These instructions are for SSH Protocol 2 (which is more secure than the older Protocol 1). Run the command

ssh-keygen -t rsa

and use blank pass phrases (this assumes that the file system on which the private key id_rsa is stored is secure; apply the Identity File patch). Use the script ssh-auth to authorize logins from the current user and host to REMOTEHOST (the argument REMOTEHOST may contain a an explicit USER@ prefix). If your keys are stored in a secure system-wide location (not ~/.ssh), you may need to edit the script. This script simply appends your newly created file to a file ~/.ssh/authorized_keys on the remote host and ensures that ~/.ssh/authorized_keys is not readable by others. If your authorized_keys file is named authorized_keys2 (a name which is now obsolete), be sure to first rename it as authorized_keys.

Back to: