ssh tunnel via multiple hops

Posted by Mala on Super User See other posts from Super User or by Mala
Published on 2010-01-16T05:58:48Z Indexed on 2011/01/31 23:28 UTC
Read the original article Hit count: 281

Filed under:
|
|

Tunneling data over ssh is pretty straight-forward:

ssh -D9999 [email protected]

sets up port 9999 on your localhost as a tunnel to foreignhost.com, but I have more specific need:

  • I am working locally on localhost
  • host1 is accessible to localhost
  • host2 only accepts connections from host1
  • I need to create a tunnel from localhost to host2

Effectively I want to create a "multi-hop" ssh tunnel. How can I do this? Ideally, I'd like to do this without needing to be superuser on any of the machines.

© Super User or respective owner

Related posts about ssh

Related posts about multiple