SourceTree gives authentication error but never prompts for password

I host my own repository at a URL of the form:

ssh://unixuser@ipaddress/home/unixuser/git/flex

The IP address in the 10. range, as we VPN into the remote network.

My working copy in my local user directory in windows.

I can use SourceTree just fine if I stick to actions on the local working copy, but any attempt to pull or push results in:

"fatal: Could not read from remote repository.

Please make sure you have the correct access rights

and the repository exists."

The thing is, that I am never even prompted for a password. I am assuming it's using the "unixuser" from the URL. It has never prompted me for a password.

I also get the same error if I attempt to clone the repository to a new local working copy.

EGit functions perfectly using the exact same working copy. I can pull and push just fine. EGit prompted me for my password the first time, and then saved it.

In SourceTree I've looked in Tools | Options | Authentication, and there are no user id's or passwords stored there, and no option to add one.

I've attempted to add/convert the ssh key I use in cygwin for remote passwordless access to the same host, and nothing I've done so far appears to work. The ssh key setup appears to be generic, and doesn't really seem to reference a particular repository.

I've also clicked the "terminal" button to launch a terminal, and then added a .ssh/id_rsa and .ssh/id_pud.rsa, and was successfully able to pull from the remote from the command line. But for whatever reason the GUI tool doesn't appear to recognize this setup.

2 answers

1 accepted

I discovered that I had successfully imported the ssh key, but had not launched the "SSH Agent". Perhaps this action should be included in authentication error messages "ssh chosen, but SSH Agent not running, launch now?"

I would still like to know why I wasn't prompted for a password though. The tool should be able to ssh in without a ssh key, though perhaps that requires the SSH Agent as well.

Though your online documentation does mention all of the correct steps, it would be nice if it SSH agent were more intuitively integrated into the SourceTree, with something to let you know what it is and when/why you should start it.

Yes SSH login is only supported via PuTTY keys right now and not manual passwords (this is also the only supported SSH mechanism in Bitbucket and GitHub). This is logged at https://jira.atlassian.com/browse/SRCTREEWIN-424. Support for OpenSSH may be added in future, we chose PuTTY because it's Windows-native and you can import OpenSSH keys (the reverse isn't the case)

smartGit also asks for your password/private key+passphrase. IMHO sourcetree also should be that smart.

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...

564 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