Я только что установил новый сервер 10.04 и не могу заставить работать туннель.
локальная машина
ssh -L 9090:localhost:9090 admin@xxx.xx.xx.xxx
Успешный вход в систему, но после этого попытка туннеля из локального браузера, http://127.0.0.1:9090
эхо на серверном терминале:
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
Пытаюсь 9090
на сервере (links http://xx.xxx.xx.xx:9090
работает)
sshd_config
идентичен предыдущему серверу 8.04, работает нормально.
В чем дело?
РЕШЕНО:
Это был вопрос политики. На серверном терминале запрошенная услуга на 9090 не ответила на
telnet localhost 9090
только в:
telnet 127.0.0.1 9090
Решение заключалось в том, чтобы добавить это в /etc/hosts
.
127.0.0.1 localhost localhost.localdomain
На основе эта тема Я думаю, что причиной вашей проблемы может быть Apache, а не sshd.
Попробуйте изменить директиву Listen в файле httpd.conf на
Слушайте 127.0.0.1:9090
После этого перезапустите httpd и посмотрите, изменилось ли это.
Подробный вывод (-vvv).
Успешный вход в систему. По запросу туннеля из локального браузера на серверном терминале:
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
Обратите внимание, что порт 9090 отвечает на
# links 127.0.0.1:9090
НА РАБОЧЕЙ МАШИНЕ: (8.04)
по запросу:
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
С уважением // т