Subversion + Alternate SSH Ports

Posted September 8, 2006

One of my clients has a firewall in front of his subversion server, which is accessed within the network with the svn+ssh method. However, outside of the network it's a different story: the tunnel through the firewall puts the public SSH interface on a non-standard port ... and svn+ssh doesn't play well with non-standard ports.

What's the work around? A one line tweak in your personal Subversion configuration file. I can only vouch for this on OS X, so your mileage may vary.

  1. Load ~/.subversion/config into your favorite text editor.
  2. Add one line to the [tunnels] section: altssh = /usr/bin/ssh -p alt_port
Then your access method to svn+altssh and you're ready to rock:

svn checkout svn+altssh://

This raises an interesting question: what other non-standard methods are people using to access their repositories?

Update:  Arlo Bendiken has a better solution to this particular problem in his comment below ... put the alternate port into the SSH config, so that any SSH interaction with the host receives the correct settings.  Thanks!

comments powered by Disqus