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.