Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 127.0.0.1 8000"? –  MadHatter Oct 30 '10 at 6:24
add comment

3 Answers

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
add comment

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

AllowTcpForwarding yes
share|improve this answer
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

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.