Last Updated on August 7, 2025 by Arnav Sharma
Using PuTTY to create an SSH tunnel for RDP (Remote Desktop Protocol) involves several steps. Here’s a step-by-step guide to help you set it up:
Requirements
- PuTTY: Download and install from PuTTY’s official website.
- Remote Desktop Client: Pre-installed on Windows.
Step-by-Step Guide
- Open PuTTYLaunch PuTTY from your start menu or desktop.
- Configure SSH Connection
- Session Settings:
- In the Host Name (or IP address) field, enter the SSH server’s address.
- Ensure the Port is set to
22. - Under Connection type, select SSH.
- Session Settings:
- Set Up SSH Tunnel
- In the left-hand category menu, navigate to Connection > SSH > Tunnels.
- Under Source port, enter a local port number (e.g.,
13389). This can be any unused port number on your local machine, essential for configuring SSH tunnel for remote desktop. - In the Destination field, enter the destination address and port in the format
destination_ip:remote_port(e.g.,127.0.0.1:3389if you are tunneling to a local machine’s RDP service). - Select Local and Auto.
- Click Add. The configuration should now appear in the Forwarded ports list.
- Save the Session (Optional)
- Go back to the Session category.
- In the Saved Sessions field, enter a name for this connection configuration.
- Click Save. This way, you can easily reuse this configuration later.
- Connect to the SSH Server
- Click Open at the bottom of the PuTTY window.
- If this is your first time connecting to this server, you may see a security alert. Confirm that you trust the server and continue.
- Log in with your SSH username and password when prompted.
- Configure RDP Connection
- Open the Remote Desktop Connection client (mstsc.exe).
- In the Computer field, enter
localhost:[local_port](e.g.,localhost:13389).
- Connect via RDP
- Click Connect.
- You should now be connected to the remote desktop through the SSH tunnel.
Troubleshooting
- Connection Refused: Ensure the port you chose for the local tunnel (
Source port) is not being used by another application. - Authentication Issues: Verify your SSH credentials and ensure you have the correct permissions on the SSH server.
- Firewall Issues: Ensure that your firewall settings allow the SSH and RDP connections.
I help organisations secure their cloud infrastructure and stay ahead of evolving cyber threats. Microsoft MVP and Certified Trainer, author of Mastering Azure Security, and founder of arnav.au — a platform for practical Cloud, Cybersecurity, DevOps and AI content.
Frequently Asked Questions
SSH tunneling for RDP provides a secure, encrypted connection to a remote desktop by routing the RDP traffic through an SSH tunnel. This adds an extra layer of security and allows you to access remote desktops through SSH servers, even if direct RDP access is blocked by firewalls or network policies.
The Source port should be an unused local port number on your machine (e.g., 13389), while the Destination field should contain the remote machine's IP address and RDP port in the format destination_ip:remote_port (e.g., 127.0.0.1:3389). The source port is what you'll use locally to connect via RDP.
A 'Connection Refused' error typically means the local port you selected for the SSH tunnel (Source port) is already in use by another application. Choose a different unused port number and reconfigure your tunnel settings to resolve this issue.
After establishing the SSH connection in PuTTY, open the Remote Desktop Connection client (mstsc.exe) and enter localhost:[local_port] (e.g., localhost:13389) in the Computer field. Then click Connect to access your remote desktop through the SSH tunnel.
Yes, you can save your configuration by going to the Session category in PuTTY, entering a name in the Saved Sessions field, and clicking Save. This allows you to easily reuse the same tunnel configuration without having to reconfigure it each time.