TortiseSVN svn+ssh Error: Unable to connect to a repository at URL ... Network connection closed unexpectedly

I finally came across a solution for this. In the TortoiseSVN FAQ of all places:
TortoiseSVN Frequently asked questions

From the FAQ:
SVN+SSH: Connection closed unexpectedly

It has been reported that svn+ssh connections of the form svn+ssh://[email protected] which were previously working, stop working with TortoiseSVN 1.5. This seems to be related to plink, and occurs if you have a default hostname set in PuTTY.

If this is the case you can fix it by using regedit or regedt32 to clear HKEY_CURRENT_USER/Software/SimonTatham/Putty/Sessions/Default%20Settings/HostName.


Another user has reported the following server-side fix:

  • ssh into your account
  • cd ~
  • cp /etc/bashrc .bashrc
  • nano .bashrc
  • put a # before the line "mesg y" (which comments it out)
  • Ctrl+X to exit, press Y when prompted to save.

I didn't try the first approach of editing my registry.

The second approach of editing the bash configuration worked for me.

A note about the bash configuration method:

If you're on shared hosting, your user .bashrc file will likely be loading the global /etc/bashrc file. You won't be able to edit the global file, so you'll need to work around that.

Some possible approaches:

  • Try adding mesg n to your user .bashrc file. I'm not sure if this will work or whether it should be placed before or after the global file is loaded.

  • Don't include the global file and hard code all the settings in your user .bashrc file.

  • Remove the mesg y setting from the global /etc/bashrc file as it's loading. This question discusses how to do that: Use a grepped file as an included source in bash


An old question, but still top of the stack on Google, so I thought I'd share my solution.

Simply, it was because I didn't have a "home" directory for my user on the server. Changing the SSH client to the plink.exe that comes with Putty (right-click on folder | TortoiseSVN | Settings | Network) allowed me to see the error as the windows appeared on screen.