Remote desktop through SSH

I sometimes telecommute. And when I badly need some files on my office desktop, I can connect remotely through the company's SSH gateway and tunnel RDP to my desktop. Here's how:


  1. Using PuTTY, create a new session for the SSH gateway.

    PuTTY session

  2. In Connection > SSH > Tunnels, add a new forwarded port: the source can be an arbitrary port number (e.g. 4444) and the destination should be the address of the remote desktop with the port set to tcp/3389 (the RDP port). Make sure the "Local" is selected because we will be forwarding the local port (4444) to the remote desktop's port (remote.desktop:3389).

    Set tunnel

  3. Connect and log in in the SSH session. (We use one-time RSA SecurID passkeys, so I always keep that nob handy.)

  4. In Windows XP (yes, my notebook is still not free), open up Remote Desktop Connection, add connect to localhost:4444. This should then be forwarded through the SSH session to the remote desktop port 3389.

    Remote desktop connection

  5. You would have to authenticate again, and if all goes well, you'll be presented with your remote desktop.

    Remote desktop


Steps 1 and 2 above can also be achieved from the command line, using Plink:

C:\> plink -N -L 4444:remote.desktop:3389 [email protected]


Take note that the SSH gateway must be able to forward tcp/3389. (Setting that up is beyond the scope of this post. ;)) It would have been great if the VNC port (tcp/5900) was set up as well, but unfortunately, only RDP is allowed. So to connect to my Linux box at work, I either use SSH or, in the remote desktop, open up TightVNC. It looks a bit surreal: having a remote desktop within a remote desktop.

Comments

Popular posts from this blog

Pull files off Android phone