svn+ssh on port other than 22

February 17th, 2010

I changed my desktop’s ssh port from 22 to another number because there are username/password scanners running in campus every minute. However, this introduces a disadvantage on running an svn server on this machine, because svn+ssh does not support port other than 22 by default.

There are plenty of dirty hacks on this problem, like export SVN_SSH="ssh -p 5555", where 5555 is (hypothetically) the alternative ssh port. I am not satisfied with this hacking because it will ruin other svn+ssh repository using port 22, and I am always working with multiple projects.

It is a pain until I find this solution. What it says there is create a ~/.ssh/config file, and add lines like:

host hellen
    Hostname liulonnie.ucsd.edu
    Port 5555
    ForwardAgent no
    ForwardX11 no

hellen is an alias for my office desktop. Then when using svn, use svn+ssh://hellen instead of svn+ssh://liulonnie.ucsd.edu.

I should really learn more about command ssh.

One Response to “svn+ssh on port other than 22”

  1. pigguo says:

    nice!
    I should change my ssh port too

RSS feed for comments on this post. And trackBack URL.

Leave a Reply