I had a case:
- Have a service in home local network.
- I would like to access this service from outside.
- I don't have routed IP in home.
- I have VPS with public IP, but I can't run OpenVPN on it.
As workaround you can use SSH tunnel with remote port forwarding.
In my example service is running on machine 192.168.3.28:8080 and I want to have access on port 8090.
First of all you have to add to your /etc/ssh/sshd_config file:
GatewayPorts yes
On my router (it doesn't matter, but it has address 192.168.3.3) I've run command:
ssh -R 8090:192.168.3.28:8080 me@jaqb.gda.pl
This command create a tunnel between server (jaqb.gda.pl) on port 8090 through my router (192.168.3.3) to port 8080 on host 192.168.3.28 in home network.
Now I can access it from anywhere.
In fact, my (great!) VPS provider allow me to run OpenVPN in less than 10 minutes so it wasn't necessary.
Add comment