Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have spent several session trying to figure this out, and tried to follow many other posts. But for some reason this is confusing to me and none of the other situations "seem" to apply.

What I want to do:

NOTE: NONE of these machines are on the same LAN.

Workstation A - A linux machine somewhere/anywhere on internet

Server - Linux Virtual Private Server out on the Internet Internet IP address

Workstation B - My Home Windows machine running RDP Internet IP address NAT IP Address

I want the Linux Server to act as an SSH "Gateway" so I can can RDP From Workstation A to Workstation B

Workstation B, is on a restrictive ISP it can't run a sshd but can connect to Server using SSH Client like Putty.

Here is my lastest effort:

So from Workstation B:

Using Putty:  Host Name ( Ip Address )
              Port                     22

              SSH Tunnel Source Port   3389
                         Local Port    localhost:3389

(updated) Checked on "Local ports accept connections from other hosts" Not Checked "Remote hosts do the same" Selected "Local" and "Auto" under destination

Then on Server:

ssh -p 33890 -L 9833: rdpuser@

Then on Workstation A:


I have tried a bunch of variations on this but I am not even certain I have a correct understanding of the whole ssh tunnel.

Also, I have a specific need for an SSH tunnel and cannot install sshd on Worstation B. I actually know how to set up PPTPD, IPsec and others but that wont work here. So if you have a different solution it is not applicable. I am only looking as to wether or not my scenario can be accomplished ( cause I am confused ) and what I might be doing wrong.

Sorry if this is long, trying to not be vague.

I looked at this post: [how-to-tunnel-windows-remote-desktop-through-ssh-using-a-linux-box][1] It was VERY close to my situation but the linux box is not on my local network.

share|improve this question

migrated from Jan 25 '14 at 3:02

This question came from our site for system and network administrators.

You skipped some details about your putty configuration. What mode did you use when setting up the tunnel? – Zoredache Jan 16 '14 at 18:11
Hmm not sure what mode means, "Local ports accepts accept connections from other hosts" was checked. "Remote Ports do the same" is unchecked. Local and Auto selected under destination in tunnel on putty. – Paul Jan 16 '14 at 18:21
Based on your comment, your conf is backwards. See:… – Zoredache Jan 16 '14 at 18:29

On A, you can run e.g.

ssh -L 33890:

This connects to by ssh, and opens a tunnel from port 33890 on A to 3389 on B. So on A you can then run

rdesktop localhost:33890

to connect to RDP on B.

The connection is encrypted between A and the server, but not between the server and B (within your LAN). If you want to encrypt that piece as well, then have B connect to the server and forward a port from the server to the RDP port on B. On B, run:

ssh -R 33891:localhost:3389

and then on A:

ssh -L 33890:localhost:33891

(You can replace 33891 by any available port on the server.) Then on A you'd connect to rdesktop localhost:33890 as before.

The disadvantage of this approach is that it relies on the connection from B to server staying up, but those will usually time out after a while. You can try to adjust that by setting ServerAliveInterval in the connection from B to server, or by using autossh to automatically restart the tunnel whenever it goes down.

share|improve this answer
I think the **-R switch ** may be the piece I was missing, trying it out ... – Paul Jan 16 '14 at 19:49

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.