SSH agent with Source Tree on Mac

I've recently upgraded to Mac OS 10.13 from 10.11. I also upgraded my sourcetree to the latest version (I can't remember what version I had before that unfortunately).

I have sourcetree setup to use SSH keys with both GitHub and Bitbucket and I've connected both accounts under preferences > accounts.

Previously when I would do a push, the first push of the day would ask me for my SSH key passphrase, but then I would be able to interact with the remote repo without needing to enter it again (presumably SSH agent was running in the background somewhere).

Now whenever I do a push I get a box saying "Password Required For user git on host github.com", which is different to the box I used to receive asking for my passphrase. Entering the passphrase seems to work for this and there is an option to store the password in the keychain, but I don't want to do this (otherwise what's the point in the passphrase). How can I set this up so it works like it used to, presumably interacting correctly with SSH agent?

1 answer

There are some changes in the OpenSSH on macOS that causes these issues. More details can be found in Apple's Technical Note - https://developer.apple.com/library/content/technotes/tn2449/_index.html

You can check if the keys are loaded to the agent and if not, load them manually. This would just work fine with Sourcetree.

To check if key is loaded, use this command

ssh-add -l 

To load keys, use this command

ssh-add <path_to_key> 

e.g.,

ssh-add ~/.ssh/id_rsa 

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published May 30, 2018 in Sourcetree

Tip from the team: configuring Git or Mercurial in Sourcetree

Supported Platforms macOS Windows To make using Sourcetree as simple yet powerful as possible we embed (bundle) dependencies such as Git, Git LFS, and Mercurial. We strive to keep these...

568 views 1 2
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you