I have recently purchased SSH Tunnel and was wondering if it can handel multi SSH hops in one tunnel … e.g.
i have the following servers. LocalHost, Jumpserver, Target System.
The issue here is the firewall rules block all ports except SSH (from the jumpserver), so i need to ssh to the jump and then ssh to the target system so i can invoke services locally (on Target system).
Is this posible?
@Jonathan_Lewis SSH Tunnel can handle SSH hops, but, not in one tunnel.
You must first create a tunnel to your Jumpserver, and add a Local Port Forwarding:
You will get a port 8022 on your LocalHost which was mapped to Target System port 22. Which means, once you connect to LocalHost:8022, the data will be redirected to Target System:22 transparently.
So next steps are straightforward, treat LocalHost:8022 as you are using Target System:22:
Keep in mind that make sure turn on Jumpserver ahead of LocalHost:8022 for the dependency reason.
Thanks for the help @yangyubo.
This is what i have tried but the issue is the Jumpserver does not have access to the target server port 3306.
i need to ssh from Jumpserver to the Target and then connect to 3306 from localhost.
In theory we need to open a Tunnel in another Tunnel. This can be done in other tools but i would like to do this in this tool.
Tunnel from localhost to host1 and from host1 to host2:
ssh -L 9999:localhost:9999 host1 ssh -L 9999:localhost:1234 -N host2
This will open a tunnel from localhost to host1 and another tunnel from host1 to host2.
@Jonathan_Lewis could you please paste the full command you have used in terminal?
Then I will try to translate it into SSH Tunnel configurations.
@Jonathan_Lewis Do you have made it work? Don’t hesitate to let me know if you need help
Hey there, this is still not working. This is what i want to do , https://superuser.com/questions/96489/an-ssh-tunnel-via-multiple-hops,.… With putty its really easy.
The option #2 in linked answer is not possible in SSH Tunnel, at least not supported by now.
But option #1 and #3 can be easily achieved in SSH Tunnel, I would recommend you go with option #3, just create two tunnels as described in #3, and turn on the two tunnels in sequence.