I would like to access the ssh port of my office linux host from home. Unfortunately the host is located behind a NAT router. So, the IP address is not publicly available. There is however access to another internet host (Server) which is unfortunately only non-root access. After a while of searching I do not find a suitable solution.
Following setup:
- Office PC (linux, root access) behind NAT (IP not public) but full Internet access.
- Server PC (linux, no root access) static and public IP and full Internet access.
- Home PC (linux, root access) behind NAT (IP not public) but full Internet access.
Possible connections: Office PC --> Server <-- Home PC
Not possible: Office PC <-X- Server -X-> Home PC
Neither the Home PC, nor the Server can initiate access to the Office PC. But both the Office PC and the Home PC can initiate connections to the Server.
Reverse SSH tunnel not possible: I tried a method called reverse ssh-tunnel. Unfortunately this requires GatewayPorts on Server set to "yes" in /etc/ssh/sshd_config, where I have no root access.
In principle it should be possible:
0) On the Server I start a userspace program which listens on 2 ports (1 incoming, 1 outgoing)
1) On my office PC I run a another program which keeps a TCP connection open to the outgoing port on the server.
2) From home I connect to Server's incoming port.
There should be a standard solution for this out there.
What is the quickest and cleanest solution to solve this?
Frank