Disclaimer: this entry is mainly a reminder to myself (the stuff you would write on a post-it), but maybe it's useful to someone else.

The subversion server at my work is (currently) only accessible from within the LAN, not directly reachable from the outside evil internet. T his 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:

ssh tunneling

Graphics used in diagram from Tango icon gallery.