Using svn+ssh with non-standard port



If you use svn over SSH you may encounter an issue related to non-standard SSH port:

[dev@serverbeep web]$ svn checkout svn+ssh://dev@dev.devserver.com/home/svn-dev/
svn: To better debug SSH connection problems, remove the -q option from 'ssh' in the [tunnels] section of your Subversion configuration file.
svn: Network connection closed unexpectedly
[dev@serverbeep web]$

It’s because ssh client tries to connect to default SSH port 22. The solution is quite easy. You just need to add to your svn configuration file ~/.subversion/config next line:

ssh = $SVN_SSH ssh -q -p 2201

It should be in section [tunnels]. And this is it. Now you can checkout or update or whaterver you need to do with your remote SVN repository.

Leave a Reply