Expose a local service on a server with a reverse SSH tunnel
ssh reverse tunnel example | ssh remote port forwarding | expose localhost behind nat via ssh | ssh | tunnel | reverse-tunnelssh -N -R 8080:127.0.0.1:3000 webuser@server.example.comOpens port 8080 on the server and forwards all connections to it through the tunnel to port 3000 on your own machine. Useful for briefly making a local development environment or a machine behind NAT reachable from the server. By default the port on the server only listens on 127.0.0.1.
Note: For the port to be reachable from outside, GatewayPorts must be enabled in sshd_config. That is rarely needed and should be considered carefully.
Also searched as
- ssh reverse tunnel example
- ssh remote port forwarding
- expose localhost behind nat via ssh