macOS keeps asking my ssh passphrase since I updated to Sierra

In the latest version of macOS (10.12.2), this is easy to fix. Just edit your ~/.ssh/config and enable the UseKeychain option:

Host *
    UseKeychain yes

There is no need to change anything else. Now everything works the way it used to work before the latest updates. You do not need to add keys to ssh-agent.


Edit: You may still need to enter your passphrase once. If you don't know it, follow these instructions to reveal it.


I had the same problem. MacOS Sierra keychain keeps asking for the passphrase. Your id_rsa should be encrypted with a passphrase for security. Then try adding it to the keychain ssh-add -K ~/.ssh/id_rsa

If your key is in another folder than ~/.ssh then substitute with the correct folder.

Keychain now knows your ssh key and, hopefully, all works now (mine did)


This fixed my similar issue:

/usr/bin/ssh-add -K

This stores passphrases in your keychain.

Update (thanks @EasyCo): This works but does not persist between restarts. @jukka-suomela's solution on this page does work across restarts. You can find that answer here:

https://superuser.com/a/1158050/234685

Tags:

Macos

Ssh