Skip to main content

Using non-standard SSH port with TortoiseSVN

Some of my students reported that they were having problems connecting to their repositories using TortoiseSVN. At first, quick checks from my end didn't reveal what caused these, but I realized soon that it wasn't a server issue. It seems like the client software that they were using (TortoiseSVN) didn't know what to make of the svn+ssh://[user]@[ip]:[port]/[repo] URL.



I use RabbitVCS on my Linux boxen and get the same "Network connection closed unexpectedly" message. A colleague at work suggested that since a non-standard port for SSH is used, I should modify my /home/<username>/.subversion/config , look for the [tunnels] section, and append -p [port number] for the svn tunnel named ssh. Since this particular repository is just one among the dozens I access, I can't modify the default svn tunnel. Instead, I added a custom tunnel for each of the servers that use non-standard SSH ports.


 



For the repo that my students were trying to access, I used ssh2212 = $SVN_SSH ssh -q -o ControlMaster=no -p 2212. So the URL now looks like svn+ssh2212://[user]@[ip]:2212/[repo] and I was able to connect successfully.



In Windows, there are several ways to do this. Since the OS doesn't have a native SSH client executable, users will rely on Cygwin, Putty, or on TortoisePlink.exe (in newer versions of TortoiseSVN).



You can try any of the following solutions (they're all searchable in the Internets) and see if you can get around the problem. I've tried them all on a Windows guest OS on VirtualBox and only the last three solutions worked.



  • Using Putty: Use saved session name from Putty in the URL: svn+ssh://[user]@[saved putty session name]/[repo]. Make sure that you configure the session to already use the correct port.

  • Using Putty: Alternately, use IP:port format for the Putty saved session name so that you still use the svn+ssh://[user]@[ip]:[port]/[repo] URL format, but you're actually calling the saved session name.

  • c. Using client packaged with Tortoise. In TortoiseSVN settings -> Network, change SSH client to "C:Program FilesTortoiseSVNbinTortoisePlink.exe" and use standard svn+ssh://[user]@[ip]:[port]/[repo] URL.

  • d. Same as d., but for the SSH client, append -P [port number]

  • e. Using a wrapper script, such as the one provided here (excellent solution btw), and use it as the SSH client executable in TortoiseSVN settings -> Network.



Hope any one of these work for you. As an inside joke from one of my sysad friends, it was also suggested that I save myself the troubles and just log in to the server and revert to the default SSH port. LOL.

Comments

  1. I should note that that code gets added into /home/USERNAME/.subversion/config under the [tunnels] section.

    ReplyDelete
  2. Jon Doblados30 May, 2010 20:30

    Thanks for pointing this out. Edited the post.

    ReplyDelete

Post a Comment

Popular posts from this blog

Thank you!

I am home, and enjoying my second lease in life, one slow day at a time. I have never been hospitalized for something as life-threatening as DHF with complications before, so it's a bit frustrating that even when I'm already out of the hospital, I could not move around as much as I want. I could not even attempt to lift and carry my son when he feels like asking me to hoist him up. I can only manage a few hours of work now and what's more disheartening is knowing that I can no longer recoup a week's worth of missed work. Well, that's how it is with us road warriors/freelancers. But I am alive. I survived my first bout against DHF + pneumonia, and I have God, family, and all the people He used to get to me, to thank for. So I'm taking this moment to write and thank EVERYONE who reached out, spread the word, contacted other people, prayed, donated blood, consoled my wife, watched over me when everyone else was exhausted, and so much more. You are all AWESOME and I

Goodbye, Facebook

About a month ago, I started getting reminders to enable Facebook Protect, some feature meant to protect certain people who may be targeted by folks up to no good or even other social media platforms. Meta specifically mentions accounts of politicians or candidates who may require additional protection during elections. So the funny thing is that I’m no politician, and I barely even post about politics. I avoid doing so as much as I can, for my sanity’s sake, and well, for friendships' sake. I felt it was a strong-arm move to impose a seeming “need”. It may look random, but I feel their algorithm checks my networks. Most likely, they’ve figured out that tons of my friends are uber active political analysts, whether self-proclaimed or not. Anyway to hell with their arm-twisting, no? I wasn’t going to give them what they want, primarily because they think they know what’s good for me, and because they didn’t bother offering an opt-out.   Some time in the afternoon of 12 Nov, I got lo
March was a good month. Not just because it's my birthday month, but I've been able to do more physical exercises as far as I'm allowed, and I've also been able to get through my first month back in the job. For the first couple of weeks, I thought I was going to do 4 hours a day at most, and turn up the heat bit by bit until I'm able to do 100% again. But I suppose having to rest over a month does have its toll. It took significant effort to try not go all in with guns blazing on the first day back at work. LOL Anyway, I'm trying something new this year. We've migrated our applications to a better platform, and we'd like to push that to the cloud this year. It'll obviously need a lot of liaising and cooperative work with other teams and domains so I'm going to do more engagement and solutioning than the usual engineering this time. Last week, we did a platform-related hackathon and a critical refresh across clusters. There's going to be a lo