SSH Keychain Access in Mac OSX Sierra

Prior to Sierra keys were persisted between logins – and with an update to ssh Keychain is no longer used by default. It can get frustrating to be prompted to enter your passphrase for a key after an upgrade and after each restart.

In your ~/.ssh/config file you will need the following lines:

Host *
    UseKeychain yes
    AddKeysToAgent yes
    IdentityFile ~/.ssh/id_rsa

Change ~/.ssh/id_rsa to the filename of your private key and if you utilise multiple keys also add an IdentityFile line for each of them.

You also need to initially add the key to save the passphrase to Keychain for the first time using:
ssh-add -K ~/.ssh/id_rsa

SourceTree broke my SSH keys

Sourcetree is a great free git GUI client for Mac and Windows. A recent update (2.4) really broke my workflow however and it took me longer than it should have to figure out what the issue was.

It seems Atlassian are enforcing a behavioural naming convention for ssh keys, which seems somewhat crazy. Rather than go through and change all my own naming conventions to align with theirs I simply created some symlinks. Problem solved.

The format needed is:

Given the syntax for creating a symbolic link:
ln -s /path/to/original/ /path/to/link
You’ll need something along the lines of:
ln -s ~/.ssh/ ~/.ssh/