svn over ssh with another port than 22

A client of mine has their own SVN repository and they where running ssh over another port than the normal 22. Doing this can be a bit tricky since svn doesn’t really like the common host:port style when using svn+ssh protocoll (or whatever you call that combo).

I’m using NetBeans (6.7.1) in Ubuntu, so was eager to get svn working directly from there. Since svn itself doesn’t like special ports, neither did NB. But after a simple search on “netbeans svn ssh port number” I surfed into (not stumbled – you know – I surf the web..) a subject in the subversion mailing list which reviled a simple solution. With ssh you can add some kind of alias for hosts for which you also can define a port etc, then it’s as simple as one two three to use custom ports with svn+ssh. I’m taking the liberty to sum the mail archive post here:

create (if not already there) a file in you home folder ~/.ssh/config

Adopt the following to your needs and add them to that file


host mysvnhost
Hostname svn.onthehost.tld
Port 80
ForwardAgent no
ForwardX11 no

Then just use svn+ssh://mysvnhost/path/to/repo with svn.

Leave a Reply