Total Pageviews

Thursday 12 July 2012

Accessing a svn server behind a firewall

the subversion server at my work is (currently) only accessible from within the LAN, which is, of course, separated with a firewall from the evil internet. This makes it a bit difficult to access the subversion server when working from home. SSH Tunneling to the rescue!
To setup an SSH tunnel (on computer home):
ssh -l username -L 8910:svnserver:80 gateway cat -
This creates an SSH connection from computer home to computer gateway and opens a listening TCP-port 8910 on the the computer home. Connections to this port will be forwarded through the SSH tunnel to TCP-port 80 from computer svnserver (as seen from computer gateway).
Now we can access the svnserver as follows (on computer home):
svn co http://localhost:8910/svn/repository/path
In a nice diagram:

Graphics used in diagram from Tango icon gallery.

FROM  http://stefaanlippens.net/ssh_tunneling_to_subversion_server_behind_firewall