If you regularly connect to a server over SSH using Terminal in OS X, setting up password-less logins is a great way to speed up the logon process.
Getting started only takes a couple of minutes, and involves generating a “key” for your account on a remote machine. Before you start it is important to make sure that the machine you’re setting this up on is secure and password protected, as anyone with access to it could log on to the remote machine.
To begin with, on your local machine, open Terminal and type:
Follow the next steps – you don’t have to give a name as it will default to id_dsa.
We recommend securing the key with a passphrase as an additional security measure. Don’t forget this as you won’t be able to use the key you’re generating.
The next step is to copy the key you’ve generated to the remote machine. To do this, run the following command, replacing user@remotehost with your username on the remote machine and the IP address of it.
cat ~/.ssh/id_dsa.pub | ssh user@remotehost 'cat >> ~/.ssh/authorized_keys'
Because the command is using SSH to upload the key you will need to enter your password for the operation to succeed.
Assuming that the process completed without any issues, you should then be able to use the following command to connect to the remote machine without entering a password (though you will need to enter the passphrase you used when generating the key, but you can add this to your keychain after the first use).