ssh/scp Login Without Password
If you want to be able to login to multiple machines, you still only have to do the first step once. After you've created the public and private key files once, you can copy the same public key to each server using the steps that follow.
NOTE: I've slightly modified these directions from Mathias' copy to be more pertinent to the specific case of a local copy of Mac OSX connecting to remote servers, but the resulting commands are identical.
First open a terminal session on your Mac and generate a pair of authentication keys. Do not enter a passphrase:
your-computer:~> ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/a/.ssh/id_rsa):
Created directory '/home/a/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/a/.ssh/id_rsa.
Your public key has been saved in /home/a/.ssh/id_rsa.pub.
The key fingerprint is:
Now use ssh to create a directory ~/.ssh as user myusername on myserver.com. (The directory may already exist, which is fine):
your-computer:~> ssh firstname.lastname@example.org mkdir -p .ssh
Finally append your new public key to email@example.com:.ssh/authorized_keys and enter myusername's password one last time:
your-computer:~> cat .ssh/id_rsa.pub | ssh firstname.lastname@example.org 'cat >> .ssh/authorized_keys'
From now on you can log into myservername.com as myusername from your terminal without a password:
your-computer:~> ssh email@example.com