0

What I'm trying to determine is how do you tunnel HTTPS traffic through more than 1 host? Normally what I do when I have to jump through 1 host is the following:

# URL Access Tunnel: https://127.0.0.1:1234
ssh -L 1234:TARGET_SERVER:443 jumphost.foo.com

Then I can connect my browser to https://127.0.0.1:1234 and I'm good to go. But now I have a 2nd jumphost I need to tunnel through, but I can't seem to make a similar SSH command work.

Diagram:

Laptop -> Jumphost1 -> Jumphost2 -> Remote_HTTP_Server

1

Use -J (or ProxyJump ssh_config keyword) to connect first to jumphost1 and then to jumphost2:

 ssh -L 1234:TARGET_SERVER:443 -J jumphost1 jumphost2

You may use N intermediate jumphosts in your ssh chain with

 ssh -L 1234:TARGET_SERVER:443 -J jumphost1,jumphost2,...,jumphostN jumphostN+1

See the OpenSSH Cookbook and the OpenSSH man page for a ProxyJump overview.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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