Skip to main content Accessibility Feedback

Fix for SSH passphrases on MacOS Sierra

Since updating to MacOS Sierra, GitHub asks me for my SSH passphrase every single time I try to pull or push.

The benefit of SSH over HTTPS is specifically that you don’t have to enter your credentials every time. From my research, this appears to be a change to how the MacOS keychain handles things in Sierra.

Fortunately, I also stumbled onto an easy fix from Josh Buchea:

  1. In terminal, run cd ~/.ssh.
  2. Next, run open . to open the .ssh directory.
  3. In the config file, add the snippet below. If no config file exists, create one first.
Host *
  UseKeychain yes
  AddKeysToAgent yes
  IdentityFile ~/.ssh/id_rsa

This tells MacOS to use the credentials stored in your Keychain for SSH. If your token is named something other than id_rsa (the default), naturally you’ll want to change that in the snippet above.

🚀 Make 2018 the year you master JavaScript! My pocket guides and mini courses are short, focused, and made for beginners. You can do this!

Have any questions or comments about this post? Email me at or contact me on Twitter at @ChrisFerdinandi.

Get Daily Developer Tips