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

Connecting to remote Git via SSH fails - SourceTree sends wrong username

I'm trying to connect to a remote Git repository, which is only accessible via authenticated SSH. SourceTree is unable to connect, always returning messages about failed authentication.

Upon reviewing the SSH logs on the server, the issue appears to be that SourceTree is sending the wrong username. Instead of sending the username I've entered, it always send my local username (my username, on my local Mac).

Here's a snippet of SSH logs from the Git server:

Sep 7 09:17:02 wuis7802 sshd 4153 : Invalid user davidsmithlocal from

Sep 7 09:17:02 wuis7802 sshd 4154 : input_userauth_request: invalid user davidsmithlocal

Sep 7 09:17:02 wuis7802 sshd 4153 : Failed none for invalid user davidsmithlocal from port 50006 ssh2

Sep 7 09:17:02 wuis7802 sshd 4153 : Failed password for invalid user davidsmithlocal from port 50006 ssh2

Sep 7 09:17:02 wuis7802 sshd 4153 : Failed password for invalid user davidsmithlocal from port 50006 ssh2

Sep 7 09:17:02 wuis7802 sshd 4154 : Connection closed by

(I've changed my IP but nothing else. Yes, on my local machine, my user name actually is 'davidsmithlocal'. I didn't pick it...)

There will be several instances of the above, repeated, as SourceTree tries to log in several times before failing. This problem exists whether I try to log in using a normal user account, root, or a Windows domain account; all can log in via SSH normally.

This appears to be a bug. Any suggestions for a workaround, or ETA on a bugfix?

4 answers

1 accepted

1 vote
Answer accepted

The user gave up on using this software. (I'd close this question, but I actually don't have permissions to do so. Any passing mods, feel free to do so.)

Edit: No moderators in sight. I've flagged this as an answer (it isn't, but that way Atlassian will stop emailing me about every day).

I had similar problem or was getting error message authentication with SSH keys failed. Did not realize that the key needs to be saved on GitHubs side as well.

going into settings then 'SSH and GPG' keys then copying and pasting and saving the key generated from Putty solved the problem

Simple but when you don't know..... actually had to dig quite a bit to find that.

Like Kumar Gujja likes this

<cite>I had such issue also,

I usually use ssh.exe provide by git distribution, for some reason SourceTree rely on putty which have is own private key format (.ppk).

To make it works I took my private key (id_rsa) convert it into ppk (id_rsa.ppk) using menu :

1. Tools=>Create or Import SSH key, Then click on Load Button and load the private key (id_rsa).
2. Click on "Save private key" as id_rsa.ppk
3. Then got to Tools => Option, under ssh key field set the new ppk.

Note :
you need to connect to your repo with your username : ssh://username@repo-git/myrepo
I'm not using default ssh deamon here, but the gerrit one.
This doesn't work with submodule referenced without username...</cite>

I have the same problem. I tried to use SourceTree and GIT for the first time, I need to access to a remote repository with SSH authentication (they have my public key, I have my private key), and I have a valid url (syntax, I entered it with and without prefix "ssh://".

I always get the message: "This is not a valid source path / URL".

The I tried the same with "SmartGit" and it worked at once ... but I would prefer to use SourceTree ....


I have this same problem. SourceTree cannot clone anything via SSH from our gitolite server, the message is always "This is not a valid source path / URL". Server logs show no access attempt so this may be something going wrong already on the client end.

Have you tried setting the user global Git user?

git config --global "myusername"

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,836 views 4 13
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