SourceTree publickey error

Hi,

I am using publickeys and do not keep the in the standard location. git on the command line works fine with it after I add the key to the agent using ssh-add and enter my passphrase, however sourcetree still gets an error. I tried using the system git form the settings but I still get a public key error. Any suggections on how I can configure sourcetree to work with my keys?

1 answer

1 accepted

This widget could not be displayed.

SourceTree picks up your SSH configuration from the standard location (~/.ssh), so any configuration you use on the command line should work the same way, unless it's dependent on environment variables. Environment variables that are defined in your terminal won't be visible to Mac OS X apps, so if your setup is dependent on that it will cause a problem; you could try defining them explicitly to prove that.

The ssh authentication agent (comes with openssh) is dependent on environment variables (SSH_AGENT_PID and SSH_AUTH_SOCK) but these are standard and not specific to my environment. I assume that ssh looks for those in order to communicate with the authentication agent.

My problem was solved by using the following, which may be useful to others on OSX:

Instead of adding your keys to the authentication agent with "ssh-add" use "ssh-add -K" which uses the OSX keychain. That seemed to work with SourceTree too, and it does not break the functionality on the shell.

Thanks, I hope I helped

Thanks for the info. I assume you installed openssh from some other generic source though - Mac OS X comes with a version of openssh pre-installed that automatically uses the keychain, which is why this isn't usually an issue.

No actually I am just using the one that came with OSX. I have a script that I wrote for adding my keys to the agent. I think the -K switch is an OSX specific thing.

Ah, I see. I only use a single key in the standard location (~/.ssh/id_rsa) and that's picked up by the keychain automatically. Good to know!

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Published 10 hours ago in Marketplace Apps

The 7 hacks of highly successful automation

...there's anything I've learnt from working, it's that people are lazy! No offense to anyone reading this, but it's true and we can all admit it. The easier you make something for someone, the more...

55 views 0 8
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