SourceTree "Authentication via SSH keys failed"

I am using the latest SourceTree for Mac (v 2.5.3 [116]). I use SSH keys to authenticate with GitHub and Bitbucket. Every time after I restart my workstation, SourceTree no longer sees my repos from either service as valid. I get the following error:

"This is not a valid source path / URL."

If I regenerate my SSH keys (and reload them to my accounts at Github and Bitbucket), then I can successfully work with my remotes again.

This happens to me on three separate Mac workstations (two early-Macboo-2015s and one Macbook-2016; one of which runs El Capitan and the other two run Sierra).

How can I avoid this without switching to HTTPS?

1 answer

1 accepted

2 votes

Hi Steven, do you have any keys loaded in your agent when you reboot your computer? You can check that using the command 

ssh-add -l

You can also try using the command line and see if you get the same error. Regarding MacOS Sierra, there seems to be an issue with it not rememebering SSH keys after rebooting that might be affecting you, you can find it at MacOs Sierra doesn't remember SSH keys between reboots .

Let us know if that's your case!


Thanks. I can't believe I overlooked that. I appreciate it!

No problem, Steven! Glad I could help :)



thanks It helps me too :D

wow thanks.. It was a Mac OS Sierra issue! No ssh keys in agent after reboot. 

I found it weird that i worked for 5 days.. and suddenly it stopped. 


ssh-add -A

Same. I need to reload this after EVERY minor system update (macOS 10.13)

Suggest an answer

Log in or Join to answer
Community showcase
Brian Ganninger
Published Jan 23, 2018 in Sourcetree

Tip from the team: workflow and keyboard shortcuts

Supported Platforms macOS Sourcetree has a lot to offer and, like many developer tools, finding and using it all can be a challenge, especially for a new user. Everyone might not love ...

273 views 0 3
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot