How to fix retyping SSH password every time (‘broken Git’) in macOS Sierra 10.12.2

After updating to Mac OS X Sierra 10.12.2 I noticed that I was no longer able to do a git push to WP Engine via Tower (my regular Git client) anymore.

Trying a git push via the terminal instead did work, however I had to re-enter my SSH password every time. Not cool.

What fixed it for me:

  1. Make sure all hidden files are visible in Finder
  2. Navigate to ~/.ssh in Finder (so if your username was Nick that’d be the Users/Nick/.ssh folder)
  3. If there’s not already a config file there create a text file (with no name extension), simply called config
  4. Enter the following text and save the file.
Host *
   AddKeysToAgent yes
   UseKeychain yes
   IdentityFile ~/.ssh/id_rsa

Now your problem should be solved.

All credit to the original solution I found on StackExchange, however I wanted to expand on that slightly for anyone not sure where or how to create a config file (as I initially wasn’t).

Leave a Reply

Your email address will not be published. Required fields are marked *