July 2014

Passwordless SSH login with multiple identities available

Recently I started creating passwordless SSH logins to servers I need to access, so I can automate tasks. I tend to create a new key pair for each server. Today it didn’t work and it took me several hours to find the solution. So this writeup is to help others (and my future self no doubt).

Create a key pair for the new server and add the public key to the authorized_keys file of the user on the remote server. How this works is written all over the internet so I’ll merely sum it up here. In the example I’m creating one for my local Mac Mini.