I have a host installed in the field that I need to connect to – call it ‘remote’. This host is only connected to the internet with an iPhone plugged into the USB port. ‘Remote’ can hit anything on the internet but nothing on the internet can hit ‘remote’ because the iPhone provides a double NAT network to ‘remote’.
I want to sit in my office and connect to ‘remote’ with NoMachine to control the ‘remote’ desktop.
I have a server in the cloud that has openssh-server installed – call it ‘relay’.
On ‘remote’, I executed:
ssh -fN -R 10022:localhost:4000 ubuntu@a.b.c.d
to create a reverse ssh tunnel so that port 10022 on ‘relay’ will be forwarded to port 4000 on ‘remote’.
Now, it seems that if I create a NoMachine connection on my desktop – call it ‘desktop’ – that connects to ubuntu at a.b.c.d on port 10022, it should be forwarded to port 4000 on ‘remote’.
I set up NoMachine on ‘remote’ by running /usr/NX/bin/nxplayer and noticed it was using port 4000. (Seems like maybe I should instead be starting some kind of server.)
When I try to connect to ‘remote’ from ‘desktop’, the connection times out.
Maybe I’m making this too complex. Does NoMachine have a better way of hitting a host behind NAT? (Nothing outside can initiate a connection to ‘remote’.) Is my method OK but doing some step wrong?
I would greatly appreciate any help!
Thanks!