2

I've just set up a new 10.04 server and can't get the tunneling to work.

local machine

ssh -L 9090:localhost:9090 [email protected]

login success, but thereafter trying tunnel from local browser, http://127.0.0.1:9090

echo at server terminal:

channel 3: open failed: connect failed: Connection refused

auth.log:

sshd[24502]: error: connect_to localhost port 9090: failed.

iptables -L

Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination  

 

Trying 9090 at server (links http://xx.xxx.xx.xx:9090 works)

sshd_config is identical to previous 8.04 server, working fine.

What's going on?

4
  • Did you try telnet localhost 9090? Also, you mentioned iptables in your question. Did you have any NAT rules? You can paste the output of iptables -L.
    – Khaled
    Jan 2, 2011 at 20:32
  • telnet over tunnel gives: Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. Connection closed by foreign host. dump of iptables is in post above. Thanks for help, :-)
    – user65297
    Jan 2, 2011 at 20:38
  • try executing your ssh command with -vvv to get more verbose output, it usually says where something went wrong
    – damir
    Jan 2, 2011 at 23:09
  • verbose output as answer, sorry for that.. new here...
    – user65297
    Jan 2, 2011 at 23:36

3 Answers 3

1

Verbose output (-vvv).

Login success. Upon request of tunnel from local browser, at server terminal:

ebug1: Connection to port 9090 forwarding to localhost port 9090 requested.
debug2: fd 9 setting TCP_NODELAY
debug3: fd 9 is O_NONBLOCK
debug3: fd 9 is O_NONBLOCK
debug1: channel 3: new [direct-tcpip]
channel 3: open failed: connect failed: Connection refused
debug2: channel 3: zombie
debug2: channel 3: garbage collecting
debug1: channel 3: free: direct-tcpip: listening port 9090 for localhost port 9090,  connect from 127.0.0.1 port 57884, nchannels 4
debug3: channel 3: status: The following connections are open:
  #2 client-session (t4 r0 i0/0 o0/0 fd 6/7 cfd -1)

debug3: channel 3: close_fds r 9 w 9 e -1 c -1

Please note that port 9090 replies upon

# links 127.0.0.1:9090

ON WORKING MACHINE: (8.04)

at request:

debug1: Connection to port 9090 forwarding to localhost port 9090 requested.
debug2: fd 10 setting TCP_NODELAY
debug3: fd 10 is O_NONBLOCK
debug3: fd 10 is O_NONBLOCK
debug1: channel 3: new [direct-tcpip]
debug2: channel 3: open confirm rwindow 2097152 rmax 32768
debug2: channel 3: rcvd eof
debug2: channel 3: output open -> drain
debug2: channel 3: obuf empty
debug2: channel 3: close_write
debug2: channel 3: output drain -> closed

regards //t

1
  • For future reference, this should be appended to your original question, not added as an answer.
    – Andrew M.
    Jan 3, 2011 at 5:56
1

Based on this thread I think the cause of your problem might be Apache, not sshd.
Try changing your Listen directive in your httpd.conf file to

Listen 127.0.0.1:9090

Restart httpd afterwards and see if that made any difference.

1

SOLVED:

It was a policy issue. At server terminal, requested service at 9090 didn't respond to

telnet localhost 9090

only at:

telnet 127.0.0.1 9090

Solution was to add this to /etc/hosts.

127.0.0.1 localhost localhost.localdomain

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .