Checkout SVN repository on another host using SSH on a custom port

Checkout SVN repository on another host using SSH on a custom port

Checkout SVN repository on another host using SSH on a custom port 1920 1091 Border Crossing UX

If you want to checkout from your svn repository running on a remote host and on that host the port used for ssh is not the default (port 22), you can run into issues. As you cannot use a custom port in the following command:

svn co svn+ssh:///home/username/repository_path

What you need to do is edit the following file: ~/.subversion/config and add (under [tunnel] section) a similar line to:

myremotessh= ssh -p 1122

What this does is sets up a custom protocol that you can use in your command to ssh to a custom port number. So, to use the above setting we’d have to run something like this:

svn co svn+myremotessh:///home/username/repository_path

This way, if you want to use svn+ssh on port 22 you can still do, while setting up custom protocols for hosts that have ssh running on custom ports.

Back to top