7

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: 80

The remote system name: remotesys
The remote port: 9090

On 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?

videoguy
  • 211
  • 3
  • 6

1 Answers1

6

You might need to change the servers config. Set GatewayPorts to 'on' or 'clientspecified'. Otherwise the remote interface is restricted to localhost

John Smith
  • 121
  • 2
  • Can it be done on a server I don't have root access? –  Jun 29 '11 at 23:46
  • No, 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 – John Smith Jun 30 '11 at 00:04
  • I can't use local forwarding as privatesys is behind a firewall. –  Jun 30 '11 at 03:26