By LUKE MCGOVERN
Published: December 7, 2008
Using the SVN+SSH protocol scheme should be a simple matter for TortoiseSVN and Putty. Strangely the web is littered with people having a lot of trouble connecting to SVN repositories with few solutions to be found. This article is bit of a troubleshooting guide and based on a number of assumptions that are listed at the end of the article.
Common errors when connecting to a svn+ssh repo include...
FATAL ERROR: Network error: Connection refused
and...
Invalid Port Number
The latter of the two is caused when you change the network settings SSH Client value in TortoiseSVN from blank to the path to Putty. Forget that one. You don't need to complicate this. Change it back to blank so it uses Plink again. Plink is based on your Putty sessions anyway.
So, once you've set the value back to blank you will be left with the original FATAL ERROR and your gripe is now with Plink.
TortoiseSVN comes with its own version of Plink (TortoisePlink.exe in the bin directory). Get yourself a copy of Plink from the Putty download page for testing.
Once you've got it, open your Command Prompt and either change to the directory containing Plink or add the path to your PATH var like...
> set PATH=%PATH%;c:\Program Files\Putty
Now you can tinker with Plink directly and get some more info on the "FATAL ERROR: Network error: Connection refused" error. Running the following should just show the options for plink.
> plink
In my case running the command saw plink trying to make a connection. What the fsck? Running it with the verbose option gave me a clue as to what was going on.
> plink -v
Plink was grabbing my "Default Settings" Putty session and was trying to access it. This was a fault on my behalf as I hadn't realise I'd overwritten the default setting while setting up another session on another occasion. I cleared out the host name and saved the "Default Settings" session and Plink was staring to act a little more normal.
Now running Plink to make the connection works a treat.
> plink -i "c:\path\to\key.ppk" user@hostname
And testing the method that TortoiseSVN uses for the connection...
> plink -i "c:\path\to\key.ppk" putty_session_name
Makes the connection and shows we're now laughing! You should now have no problem getting the repo browser to connect. If you are still having problems the verbose output for Plink is extremely useful for debugging.
On the TortoiseSVN site there is the advice to test the set up using following command.
$ ssh svnserve
If you get the reponse "ssh: svnserve: Name or service not known" you may not need to be too concerned. You just need to be sure the remote user can access svnserve. You can test by doing...
$ which svnserve
Other advice on the web mentions to add command="/home/usr/bin/svnserve -t" to the authorized_keys file. I didn't find this neccessary to make the connection work.
You can access your remote server with a set of SSH keys via Putty. (It doesn't matter how you generate the keys so long as they work.) This step is detailed in many other articles.
The session you created in Putty has a name that doesn't have any spaces or weird characters.
The SVN repository is working and there are no permissions issues with user. This can be tested by checking out a local copy on the remote machine.
...
Standard disclaimers apply to this article. The advice given comes with no warranty and should only be taken at own risk.
By LUKE MCGOVERN
Published: May 9, 2010
The templating system for the SilverStripe framework is a majorly crippled piece of work. The big question is: why?
By LUKE MCGOVERN
Published: June 30, 2009
Adobe Dreamweaver CS4 now comes with SVN integration. It's their one big feature for developers in this version. To bad it's completely useless.
Comments
Thanks Luke, you saved my day. I was getting crazy with the TortoisePlink.exe and Plink.exe network error: "Connection refused";
Thanks to the magical -v option, I understood that I too had a default session, and that plink was ignoring the one provided on the command line :-(
It's now working, thanks a lot!
Thanks man, helped me a lot - I deleted the hostname in the Default Settings in PuTTY, now Plink doesnt ignore the hostname at the command line.
Any Comments?