Adding all ssh keys automatically to MacOS High Sierra

Since upgrading to High Sierra, I’ve had to manually add keys after every reboot using ssh-add like this:

ssh-add -K

I don’t reboot often but for a while I was rebooting often enough to make it annoying. So I found that you can link ssh with MacOS keychain using your .ssh/config file, add all the keys to your agent, and everything works smoothly.

Host *
UseKeychain yes
AddKeysToAgent yes

Then add all your keys to the keychain using

ssh-add -KA

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.