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

Advertisements

Leave a Reply

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

WordPress.com Logo

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

Google+ photo

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

Twitter picture

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

Facebook photo

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

Connecting to %s