A colleague of mine recently showed me how to get Windows Remote Desktop working over an SSH tunnel. The instructions below assume that you have a target machine set up to accept remote desktop connections and a working SSH tunnel such as stunnel.
- On the client Windows XP machine, copy
mstsc.exe
andmstcax.dll
from theWINDOWS\system32
directory to a new directory (likec:\rdp-ssh
). - Right-click the new copy of mstc.exe and chose Properties from the context menu. Click the Compatibility tab and check the Compatibility mode checkbox. Choose Windows 98/Windows Me from the Compatibility mode dropdown.
- Add port 3389 to your SSH tunnel, mapped to the remote desktop host on the destination side. (Re)start your SSH tunnel.
- Start
c:\rdp-ssh\mstsc.exe
and enter localhost as the hostname.
Windows requires the compatibility-mode change because the remote desktop client normally objects to connecting to localhost, thinking that there’s already a desktop session there.