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'm looking to forward requests from port 8003 on the remote machine to my localhost at port 8080

share|improve this question
up vote 2 down vote accepted
ssh -R 8003:localhost:8080 ...
share|improve this answer

The OpenSSH command line given works just fine, but a few additional options make it complete:

ssh -R 8003:localhost:8080 -f -N -g root@remhost

Note that this will then forward any connections to 8003 to your local host on 8080; the connection is host-to-host. The -g option means anyone will be able to connect to that port on the remote machine. If you take out that option, only people using the machine directly will be able to use the tunnel.

The other options will put the tunnel into the background and keep it running without intervention.

share|improve this answer

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.