How to Tunnel Remote Desktop Through SSH

Recently I wanted to set up a remote desktop connection when I was away from home to my home server.  While VPN is great I found that SSH tunnels are even better. I use my good old Raspberry Pi as the “gateway”. So here goes…

My Raspberry PI SSH address:

Server I want to RDP to:

Open Putty and first enter the IP address of the remote SSH host (in my case RPi), name the connection and click Save:


Then in the Category menu scroll down to Connection/SSH/Tunnels and enter the Source port (you will be connecting to that port locally) then the destination IP address and port, click Add button, go back to Session and Save it all.


And that is nearly it. Click Open to establish the SSH tunnel, once connected open Remote Desktop Client and in the Computer field type in: localhost:9090


And that is it. As simple as that.

When working on a linux workstation the same thing can be acomplished with this command:

ssh -f -L 9090: -N

and then user RDP client to connect to localhost port 9090.


Side note: the same tunnel can be used to connect to local proxy, mysql server and anything else that is running on the other side of the SSH tunnel.