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'm working from a network that blocks some high ports which prevents me from SSH'ing into my Windows machine on my home network from my Mac. I normally use the following command to establish a tunnel that I connect over with the Remote Desktop client on OS X.

ssh -p 22601 -L3389:Windows:3389 user@Ubuntu1 -N

In this case I have 2 machines:

  • Server A: Ubuntu1 (port 22601)
  • Server B: Windows (port 3389)

In order to work around port 22601 being blocked on my current network I could tunnel through another machine. Let's call it Ubuntu2 and it has an SSH server running on port 22. I've tried a couple of combinations, but I can't seem to make this connection work. I've got the same SSH public key access for Ubuntu 1 and 2. In all cases I'm using the same username.

What command line should I be executing to do this, and do I have to do anything else in the SSHd configuration on Ubuntu2?

share|improve this question

Take a look at the following:

Chaining these together with the relevant port numbers should do the trick.

Alternatively, you can use ProxyCommand to make it more transparent:

share|improve this answer

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.