Enable SSH key authentication

Client Configuration

Check for SSH keys

$ ls -al ~/.ssh

Generate a key pair on the client

$ ssh-keygen -t rsa -C "user@example.com"

Add your key to the ssh-agent

$ eval "$(ssh-agent -s)"
$ ssh-add ~/.ssh/id_rsa

Server Configuration

Install the public key on the servers

$ ssh-copy-id -i .ssh/id_rsa.pub user@example.com
$ pbcopy < ~/.ssh/id_rsa.pub

Restrict password log in access

$ passwd -l user
$ ssh user@example.com