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 web server running on port 8000 on remotehost. I set up a tunnel from localhost:

    ssh -L 8888:localhost:8000 remotehost

However when I try to request localhost:8888 I get:

    channel 3: open failed: connect failed: Connection refused

on the terminal. Why does the connection fail? How should I fix it?

share|improve this question
On remotehost, what happens if you do "telnet 8000"? – MadHatter Oct 30 '10 at 6:24

Sounds like there's nothing on that port on the other side at localhost:8000. Use netstat to verify that something is listening.

share|improve this answer

In your sshd_config file on the remotehost do you have this?

AllowTcpForwarding yes
share|improve this answer

Try connecting to localhost:8000 on remotehost. It could be that there is no program running on that port.

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.