Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

What's the best way to do a svn commit over reverse ssh?

Typically when using svn we access it over svn+ssh, but I have an instance where the box making the modifications can't ssh into the svn server, BUT the reverse isn't true, the svn server can ssh into the change box. So what I would really like to do is be on the svn server and tell it to remotely connect, add files, and commit.

The only way I have thought of to do this would be to ssh from svn server to the change box opening a tunnel for ssh, and then use svn+ssh tunneled through the first connection which seems overly complicated.

Is there a better way to do a reverse connection through SSH?

The svn server is FreeBSD while the change box is OpenSuse. I could put in a request to open s hole in the firewall; in consider all requests a natural question is if this is necessary and what are the alternatives and their associated level of pain

share|improve this question
up vote 1 down vote accepted

One possibility is to start snvserve on the svn server, start a reverse tunnel from the svn server to the change box, then run svn on the change box as if it was talking to a local svnserve instance. The ssh setup would be

user@svnserver$ ssh -R 3690:localhost:3690 changebox

The -R flag to ssh "specifies that the given port on the remote (server) host is to be forwarded to the given host and port on the local side."

share|improve this answer
This is basically what I was doing; the start svnserve may be a tad different in that I start it per a typical ssh tunnel. Basically: 1. SSH to the svn server 2. From there ssh to the the change box, opening a remote tunnel (similar to the answer) 3. Run subversion, telling it to use svn+rssh where I define rash as ssh -p 2002 so that it connects to localhost 2002 ssh -t svnserver ssh -R 2002:localhost:22 changebox svn --non-interactive --config-option config:tunnels:rssh="ssh -p 2002" up – W3t Tr3y Jun 30 '14 at 18:35

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.