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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

ssh authentication still prompts for password

I'm have setup SourceTree to connect to my Git repo using SSH without password. My public key has been successfully stored on the Git server.

However, I'm repeatedly getting prompted for a password to authenticate the user 'git'. I can see on the Git server that my key exchange is successful.

Jun  1 14:16:19 Ptk-Controller sshd[28381]: Accepted publickey for git from port 53452 ssh2: RSA 22:1c:2d:43:1a:30:ba:73:8b:f0:74:c1:12:69:cc:58
Jun  1 14:24:23 Ptk-Controller sshd[29046]: Accepted publickey for git from port 53758 ssh2: RSA 22:1c:2d:43:1a:30:ba:73:8b:f0:74:c1:12:69:cc:58
Jun  1 14:26:43 Ptk-Controller sshd[29142]: Accepted publickey for git from port 53884 ssh2: RSA 22:1c:2d:43:1a:30:ba:73:8b:f0:74:c1:12:69:cc:58
Jun  1 14:32:07 Ptk-Controller sshd[29630]: Accepted publickey for git from port 54018 ssh2: RSA 22:1c:2d:43:1a:30:ba:73:8b:f0:74:c1:12:69:cc:58
Jun  1 14:36:03 Ptk-Controller sshd[29853]: Accepted publickey for git from port 54171 ssh2: RSA 22:1c:2d:43:1a:30:ba:73:8b:f0:74:c1:12:69:cc:58

My repo is configured as (I did read somewhere to include ssh://, but this threw up different issues).

As things are I can successfully push/clone etc using SourceTree.

Any ideas why the password prompt is happening?

5 answers

I had a very similar problem on OS X. Remote accessed through SSH (url: git@...). Authentication: private / public key pair. Each fetch or pull caused prompt for password for user "git". When I entered the password to my private key it went on. Problem was SourceTree never respected the "store password in keychain" option and asked for password each time I wanted to do a fetch or pull (pull caused two prompts!).

Today I found a solution to that problem: 

ssh-add ~/.ssh/id_rsa 

Unfortunately this command must be issued after each restart and it's interactive because you have to input the password to your private key.

I am having same issue with source tree 2.3.1 running on OS X 10.11.6.  I have generated ssh key so I can run command line git (push, clone, branch, pull, etc) with no issues.  I have reinstalled sourcetree after using app uninstall to completely remove all the dependency directories.  Then I tried renaming the Keychains directory and then reboot so it would not be involved.  Best I can do is clone a local repository via command line and then I can add the cloned local repository to source tree and it looks fine.  As soon as I try pushing a modification via sourcetree it complains.  After moving Keychains directory back again I have searched for sourcetree, bitbucket,  Atlasssian or anything related and find nothing.  I don't know what else to try.  window keeps popping up asking for 'Password Required ... for user xx on host yyy ... with a check box to store password in keychain.

It's been 2 years since this was last posted, and I get the same problem on Mac. 

I've checked with a colleague who is running sourcetree on a Mac and he does not get this authentication prompt.

No, just a passphrase and pageant is handling that aspect of things. I can safely connect to the git server using my public key/passphrase with putty.

Is your private key password protected?

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Sourcetree

Tip from the team: configure your repos for hosting goodness!

Supported Platforms macOS Windows We recently introduced support for additional hosting services such as GitHub Enterprise, GitLab (Cloud, Community Edition, Enterprise Edition), and...

5,733 views 4 12
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you