Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

Take a look at the following:

http://blog.allanglesit.com/2011/11/ssh-hop-through-multiple-hosts/

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

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

http://backdrift.org/transparent-proxy-with-ssh

share|improve this answer

Your Answer

 
discard

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.