Linux – how to tunnel Windows Remote Desktop through ssh using a linux box

linuxputtyrdpsshssh-tunnel

I have two physical servers in my home network, linux (192.168.8.x) and windows server 2008 (192.168.8.y).

The linux server ist accessible from outside by ssh on a non-standard port (say 23008).
How do I establish a permanent RDP tunnel through ssh on the linux box? I know that I can use putty on the outside machine, but I don't know how to set up sshd on the linux box correctly.
Thanks for any hints!

Best Answer

Assuming your linux box is accessible from the internet at 1.2.3.4 on port 23008, on an external system I would do:

external% ssh -p 23008 -L 13389:192.168.8.y:3389 username@1.2.3.4

I'd then connect to the port-forwarded RDP system with

external% rdesktop localhost:13389

If your external box isn't a linux box, there will be equivalent commands for the tools you have; the idea is still the same: to forward external's port 13389 to 192.168.8.y's port 3389, then use external's RDP client to connect to localhost:13389.

You refer to setting up the linux box's sshd correctly, but unless you've reconfigured it, the standard sshd setup is likely to support this just fine.