Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

migrated from Jun 30 '11 at 4:35

This question came from our site for professional and enthusiast programmers.

@Ken, Please do a search of ssh on this site and you will see lot of questions being asked about it. It is a tool used by programmers. The beauty of this site is its ability to categorize automatically based on tags. We don't need policing like in old days with cross posting across multiple newsgroups. I don't understand what you mean by "zero accepts ... unacceptable". – videoguy Jun 30 '11 at 3:16
up vote 5 down vote accepted

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

share|improve this answer
Can it be done on a server I don't have root access? – videoguy 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 0:04
Please don't answer questions that are clearly off topic. If you're not sure what is and isn't, please spend a few minutes reading the FAQ. Answering off-topic questions encourages others to post them as well, and adds clutter and noise that make this site less useful. Thanks. :) – Ken White Jun 30 '11 at 0:07
@Ken, I often answer questions if I'm confident they will be migrated to Server Fault or Super User -- an answer is an answer regardless of the final destination for the question in question. Outright offtopic questions, you're absolutely correct, but if the question can be migrated to the right place within the Stack Exchange, I'm quite happy for answers to show up. :) – sarnold Jun 30 '11 at 0:46
I can't use local forwarding as privatesys is behind a firewall. – videoguy Jun 30 '11 at 3:26

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.