Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have configured SSH to be on port 20000. When I try:

svn co svn+ssh://server.com:20000/home/svn/proj1 proj1 --username jm

I get

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

I think I need to tell SVN to use port 20000 also?

I am on Ubuntu 11.10

share|improve this question
up vote 15 down vote accepted

You can define a new 'tunnel' in your Subversion configuration (~/.subversion/config). Find the section [tunnels] there and define something like:

foo = ssh -p 20000

Afterwards you can contact your repository via the URL svn+foo://server.com/home/svn/proj1 proj1.

share|improve this answer
Also, if you want to override the default svn+ssh protocol's port, just define ssh = ssh -p 20000. This assumes you've modified /etc/ssh/sshd_config on the server so that Port 22 is replaced with Port 20000. – DevNull Sep 29 '13 at 18:01
@Dogbert: it doesn't work like you say: I tried ssh = ssh -p 20000 and then tried to checkout svn+ssh://example.org/var/svn-repos/mydev/trunk but this still tries on port 22 – rubo77 Jan 26 '15 at 16:15

Whenever you need to access an ssh server on a non-default port or with a different user name, you can define an alias in ~/.ssh/config.

Host mysvn
HostName server.com
Port 20000
User jm

Then run svn co svn+ssh://mysvn/home/svn/proj1.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.