Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

SourceTree publickey error

knservis September 27, 2012

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

0 votes
Answer accepted
stevestreeting
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 27, 2012

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.

knservis October 1, 2012

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

stevestreeting
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 1, 2012

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.

knservis October 2, 2012

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.

stevestreeting
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 2, 2012

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
TAGS
AUG Leaders

Atlassian Community Events