I have a Raspberry Pi (remote) which is behind a NAT. In order to access it from my home computer (local), I connect it to my ASW server (server) via reverse tunnel as described in various posts.
Remote connects to server:
ssh -f -N -T -R22222:localhost:22 -i ssh-ec2/ec-key.pem ec2-user@xxx.xxx.xxxx.xxx
I can then connect to my ASW server via SSH and once I'm logged in I can connect to my Raspberry via:
ssh -p 22222 pi@localhost
That all works fine.
My problem now is, that I want to do remote session with intellij from my local directly to my remote Raspberry. For that I need to connect to my server via SSH and then manually enter again the connected to my remote.
How can I set up a tunnel so I can connect to my server, but directly to port 22222? I have tried the following from my local machine, but the connection times out:
ssh -l 9999:localhost:22222 ec2-user@52.201.173.131 -i c:/privatekey.pem
Any suggestions what I'm doing wrong? Sorry I'm totally new to Linux, so apologies if that's a stupid question.