Matt Parkinson

MSci + ARCS + PhD + DIC

Analytical Scientist

Field Service Engineer

NMR Spectroscopist

Doodle Creator

Maker

Matt Parkinson

MSci + ARCS + PhD + DIC

Analytical Scientist

Field Service Engineer

NMR Spectroscopist

Doodle Creator

Maker

Project

SSH public key authentication

16 Jul 2012 IT

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.

  1. on client create ~/.ssh directory with permission 700
  2. on client create public and private key pair with passphrase
    client:~> ssh-keygen -q -f ~/.ssh/id_rsa -t rsa
  3. transfer public key from client to server
    client:~> scp ~/.ssh/id_rsa.pub user@server.example.com:~
  4. 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).