How to allow remote connections from non localhost clients with ssh remote port forwarding?
You might need to change the servers config. Set GatewayPorts to 'on' or 'clientspecified'. Otherwise the remote interface is restricted to localhost
Related videos on Youtube
videoguy
Updated on September 18, 2022Comments
-
videoguy over 1 year
I have a system say "privatesys". I am trying to give access to its web server through a remote proxy using ssh remote port forwarding like below.
Private sys name: privatesys
Port exposed: 80The remote system name: remotesys
The remote port: 9090On privatesys, I ran the following command.
ssh -N -R remotesys:9090:localhost:80 -l username remotesys
It set up a tunnel between privatesys and remotesys and the port forwarding worked fine as long as I connect to port 9090 from remotesys.
What I like to do is access
http://remotesys:9090/
from systems that are on the same sub net as remotesys. When I do that, I am getting invalid url error from browser. Looks like the sshd on remotesys is bound to localhost instead of all the interfaces on the system.What is the trick to get sshd on remotesys accept connections from any system on its sub net?
-
Admin almost 13 yearsCan it be done on a server I don't have root access?
-
John Smith almost 13 yearsNo, you need to edit the sshd_config. But you could try to login at the server and use a local forwarding. Like: ssh -R *:9090:localhost:80 -l username privatesys
-
Admin almost 13 yearsI can't use local forwarding as privatesys is behind a firewall.