Monday, December 13, 2010

SSH tunneling to access svn repository hidden behind a firewall.

Let's assume you have a repository link like:


and you cannot access the <repositoryhost> directly but you can access the <repositoryhost> from the <proxyhost>

On the client's machine do:

ssh -Nf -L443:<repositoryhost>:443 <username>@<proxyhost>

The -Nf is optional - but it forces ssh to not create an interactive session but only do the port forwarding.

Then you can check out you repository using:

svn co https://localhost/<reponame>

If your repository link doesn't start with https:// you need to change 443 to another port number when doing the ssh.

Default ports by protocol:
  • https:// port 443
  • svn:// port 3980
  • http:// port 80
  • ssh+svn:// port 22

1 comment: