Saturday, May 10, 2008

Tunnel Behind a Firewall to Connect with rdesktop (or mstsc)

Ok, ok, so we really have a couple of Windows computer at work that are being used to serve up Rails applications. They are firewalled so they don't accept rdesktop connections over their public IP. We do, however, have a trusty Linux box running an ssh server that has access to these Windows boxes via our internal network. This makes it possible to work from home, restarting mongrels and such, by tunneling through the Linux server. First you need to set up the tunnel. This is done as follows:

That is, create a tunnel through that connects to the internal network computer on port 3389. Here, I have also set up the local port to be 3389 because it is the default rdesktop port and thus I have one less thing to specify to the rdesktop command. After this tunnel is set up you can connect simply:

To do this from a Windows machine you will need to install cygwin or putty to set up the tunnel and of course the command to connect is then mstsc.

1 comment:

  1. Hey David,

    If you don't mind, would you care to share your Windows machine configuration for hosting your Rails applications? I assume these are in house applications.

    Thanks in advance David.