I am trying to connect to a server behind a firewall.
For this connection I have to use more than one jump server.
So I SSH local → user1@jump1 → user2@jump2 → user3@server.
I can connect directly to the server with
ssh -J user1@jump1,user2@jump2 user3@server
I want to tunnel a connection between Sublime Text on my local computer and rmate on the destination server. I followed the instructions on data36. In the description, the user just connects to one server with
ssh -R 52698:localhost:52698 user3@server
I have not found something similar for three servers. Is there an option to do this? Maybe someone could give me an example with the ports.
I have tried
ssh -R 52698:localhost:52698,52698:jump1:52698, 52698:jump2:52698, 52698:server:52698 -J user1@jump1,user2@jump2 user3@server
but this gives me the error:
Bad remote forwarding specification 52698:localhost:52698,52698:jump1:52698,52698:jump2:52698,52698:server:52698
The names jump1, jump2, and server stand for the respective IP addresses. So in the real ssh command, I use IP addresses and not names.
The reason the command isn't working is that
jump1andjump2don't have correspondingrmateservers listening on those particular ports and forwarding on the the next server, so the signal dies atjump1. If you have shell accounts onjump1andjump2, you could set uprmateon each one, as well as on the finalserverbox.Theoretically this should work, but I don't have any way of testing it. For more help, you can also try posting on the official Sublime Text Forum to see if anyone with more experience than I can give you some suggestions.