David R Newman

Setting up an SSH Tunnel and checking out SVN behind a firewall

If you want to access the SVN repo on a machine behind a firewall but there is a box on the DMZ that you can SSH through use teh following instructions.

  1. On the machine you want to checkout the SVN run the following command:
     ssh -L 5678:firewalled-box.com:22 dmz-box.com
  2. On the machine you want to checkout to, edit the Subversion config (~/.subversion/config) and add the follwoing command under [tunnels]:
    sshtunnel = $TUNNEL_SSH ssh -p 5678
  3. On the machine you want to checkout to run the following svn command:
    svn checkout svn+sshtunnel://<username>@localhost/path/to/repo
  4. Now you need to switch the repo as it will appear to be from localhost. Not where it is actually from:
    svn switch --relocate svn+ssh://<username>@<repo>/path/to/repo svn+sshtunnel://<username>@localhost/path/to/repo

Partially based on http://tomorrowisfriday.wordpress.com/2007/11/28/tunneling-subversion-for-the-svnssh-protocol/

Back to Help Index Page

Page written by David R Newman (drn[at]ecs.soton.ac.uk). Last updated November 11 2013 14:34:10.