Sunday, February 10, 2008

SSH Tunneling Example (RDP)


Machine A is an XP machine with Cygwin installed, including the necessary SSH client related software. Machine A also has the remote desktop protocol (RDP) client software installed. Machine B is a Linux machine with SSHD running that we have have root access to. Machine C is an XP machine that allows incoming RDP sessions provided the client has the correct credentials. To use A to take over C via an SSH tunnel through B, do something like this from a Cygwin shell on A:

ssh -l root -L 55555:<C_IP_ADDRESS>:3389 -N <B_IP_ADDRESS>

-- Supply the root password for B when prompted.
-- Then, use the RDP client on A to connect to C via localhost:55555.
-- Supply the correct login data items for C.
-- Port 3389 is the default RDP port.
-- On an XP machine, the RDP client software is "mstsc.exe"