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 1.2.3.4

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 1.2.3.4 port 50006 ssh2

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

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

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

(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

This widget could not be displayed.

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.

This widget could not be displayed.

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

This widget could not be displayed.

Have you tried setting the user global Git user?

git config --global user.name "myusername"

This widget could not be displayed.

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 git@git.xyz.de:xyz.de), 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.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Monday in Teamwork

The tools we make for teams? We use them every day at Atlassian to get shit done (and it works).

I’m Jess, a Product Marketer for Jira Software Server and Data Center, and now a huge fan of our products. Read on for a 90 day, new-hire perspective on what it’s like to standardize on the Atlassian...

30 views 0 3
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