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

Failed to connect with SourceTree over SSH

Thomas Herchenroeder September 18, 2015

On Windows7, using SourceTree 1.6.20 I cannot connect to the remote server over SSH. Fetch, pull, etc. fail. Neither OpenSSH nor Putty/Plink in the Client SSH Configuration works. (Everything is fine with Git from the command line).

With OpenSSh, the CMD prompt for my passphrase opens and closes immediately, without any chance to actually enter the passphrase (This used to work on my old machine with the same key pair).

With Putty/Plink, I'm presented with a server SSH fingerprint which I cannot accept (as it is only in the "Show Full Output" dialog which is not interactive).

Running Plink directly on the command line offers a different fingerprint, so accepting this has no effect on the SourceTree behavior.

7 answers

1 accepted

3 votes
Answer accepted
rrudnicki
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 22, 2015

Hi Thomas, 

Did you checked this configuration? https://confluence.atlassian.com/bitbucket/how-do-i-use-ssh-with-sourcetree-282173660.html

Also are you getting some error or the cmd prompt just close?

 

In case you still face issues, raise a ticket with us smile

 

Regards, 
Renato Rudnicki 

Thomas Herchenroeder September 23, 2015

Hi Renato, Thanks for getting back. - I went again through the steps of the link you provided. Once I entered the repository source URL and tab to the destination path, I get this error: "The OpenSSH agent is running but the server still rejected your connection. You may need to add the correct key to your agent by selecting Tools > Add SSH Key. ..." Let me say that at this point I had already added my private SSH key alright. (This is also the error message I get when pulling/pushing on a repo that I added from a local working copy.) Choosing "Close" on the error dialog leaves me with the "Clone / Add / Create Repository" dialog, where the Repository Type field is set to: "? This is not a valid source path / URL". Clicking the associated "Details..." button opens another message window saying: "Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists." ----- As for the cmd prompt, it flashes by so fast that I cannot say if it contains an error message or not. Is there anyway to make it stay open? I'll open a ticket, and will link to this question. Thanks, Thomas

3 votes
Maik Hoffmann September 23, 2015

Hi,

I got the same problem. If I want to push or pull to/from my external (2nd) repo the program does not ask for login/password. Just present:

git -c diff.mnemonicprefix=false -c core.quotepath=false push -v --tags --set-upstream Home-CB master:master
Pushing to ssh://xxxx.ddns.net/home/xxxx/repos/Thxxx

FATAL ERROR: Server unexpectedly closed network connection

fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

With pure git-bash and tortoise-git it works.

 

And NO I don't want to use public-key for several reasons.

Tim Boundy October 18, 2015

That's not the same problem, the OP is getting a password prompt but it vanishes immediately, and they're getting SSH fingerprint issues, depending on which method they use. You're just not getting any password prompt at all, with no SSH fingerprint issues. I am however getting the same issue as you. No password prompt, SourceTree just fails with the "FATAL ERROR: Server unexpectedly closed network connection" after the server drops the connection because no password was provided after some timeout. TortoiseGit and Git Bash both work fine for me too.

2 votes
childnode January 29, 2016

it's a bug to me. just open Putty once and try to connect to the host via ssh. Yes this mostly won't work since you don't have complete shell access on most git hosts but putty will prompt you for the same message confirmation.

Accept it, switch back to SourceTree and: happy fetching

 

1 vote
Rahul Agarwal October 20, 2015

I have the same issue. It used to work fine for me but does not work since Win 10 update. I have installed the latest  Source Tree. I think the cmd prompt to enter passphrase does appears briefly but disappears before I can enter it. 

Git bash is all good.

Thomas Herchenroeder October 20, 2015

Try starting SourceTree from the Git bash (rather than desktop icon, start menu, etc.).

Libor Nenadál June 4, 2016

No change, does not work either.

0 votes
Thomas Herchenroeder July 4, 2016

@Libor Nenadál The ticket status is "Closed, resolved with existing knowledge". The solution was what I wrote in my comment to Rahul: Start SourceTree from a Git Bash prompt (you might have to specify the complete Path to the SourceTree executable). Then the ensuing command prompt for your passphrase stays open and the passphrase can be entered.

0 votes
Libor Nenadál June 4, 2016

What is the ticker status? When I try to access the URL it says: "You do not have permission to view this request." sad

0 votes
Thomas Herchenroeder October 20, 2015

Here is the corresponding ticket over at Atlassian Support: https://support.atlassian.com/servicedesk/customer/portal/1/STSP-2437

Jim_Hobday October 24, 2018

That link is broken

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events