SSH public key authentication
SSH public key authentication is used to establish ssh connection without the need to type a password. The details have be covered very well by many many other people like this. This post is just to remind me how to do it!
This process will allow the establishment of an SSH connection from client to server without a password. Remember you push your public key identity to the server to allow the server to verify your identity.
- on client create ~/.ssh directory with permission 700
- on client create public and private key pair with passphrase
client:~> ssh-keygen -q -f ~/.ssh/id_rsa -t rsa
- transfer public key from client to server
client:~> scp ~/.ssh/id_rsa.pub user@server.example.com:~
- on server add public key of client to authorisedkeys file
server:~> cat ~/id_rsa.pub >> ~/.ssh/authorized_keys2
Follow process in reverse to allow password free authenitication from server to client.
Remember to use a real passphrase, and get OS X to remember the passphrase in your keychain (dialogue will spring up when you first try and connect).