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

Uncle Bong in SG

It's been over two decades since I last saw Uncle Bong. He would usually drop by Diamond Village in Novaliches, Quezon City to visit Lola Magding and my mother's side of the family there. Back then, I was still in college, and I think he had also just started working, in the automotive industry. He has since worked in cruise ships and it was a good stroke of fortune when he told me that they would be dry-docking in Singapore. Mama's side has always been close-knit and could see the fondness in his eyes as he recalled his dealings with Lola Magding and her children, Mama included. He would then share stories of how many of our relatives emigrated off the "isla" to find better opportunities in Manila. Given the brief opportunity, I'm still blessed to have seen him again after all these years. I am also happy that he was able to meet Mae and his "apos". Until we next see each other, Uncle Bong!

Being a Systems Administrator @37signals (Podcast)

 I use Basecamp a lot. Kudos to these guys for making my job as a Systems Administrator more bearable than usual. :p Episode #12: Being a Systems Administrator at 37signals Time: 22:50 | 04/13/2010 |  Download MP3  |  Link to this episode Mark, Joshua, and John on life as a 37signals Sys Admin The Sys Admin team discusses hosting the 37signals apps, working with programmers, helping support, telecommuting, dealing with vendors, improving speeds in Europe, and more. Related links: Rackspace Dell Definitions: Redundancy Facebook Just Gets It Right via  37signals.com  
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