SSH 隧道“通道 x:打开失败:连接失败:连接超时”

SSH 隧道“通道 x:打开失败:连接失败:连接超时”

我用谷歌搜索并广泛搜索这个问题的某种“解决方案”;然而,我得到的最好答案是“无能为力”。当然,这并不令人满意,所以这里是:

我在家里设置了一个 SSH 守护进程,我想通过 SSH 隧道连接它。 SSH 工作没有问题。隧道似乎也没有问题。本地执行的命令是...

~$ ssh [email protected] -p 53256 -D11323

家里的东西有一个路由器,它将端口 53256 端口转发到我的 ssh 服务器的端口 22。一切都连接良好,并且隧道表面上工作正常。在机器上,我为 127.0.0.1:11323 设置了 SOCKS 代理,并且可以正常访问网站。但是,当访问特定网站(例如 ubuntuforums.org 或 fedoraforums.org)时,连接会严重挂起。然后,具有 ssh 命令的 shell 会吐出标题中的错误,并且连接失败。读完后,我得到的最接近的答案是“服务器负载或配置不当”存在问题。然而,令我困惑的是,我完全无法通过隧道连接到这些网站。话虽如此,有人能提供解决方案吗?

编辑:这是启用 SSH 的 -vv 选项直至失败的输出:

debug1: Connection to port 11323 forwarding to socks port 0 requested.
debug2: fd 11 setting TCP_NODELAY
debug2: fd 11 setting O_NONBLOCK
debug1: channel 5: new [dynamic-tcpip]
debug2: channel 5: pre_dynamic: have 0
debug2: channel 5: pre_dynamic: have 3
debug2: channel 5: decode socks5
debug2: channel 5: socks5 auth done
debug2: channel 5: pre_dynamic: need more
debug2: channel 5: pre_dynamic: have 0
debug2: channel 5: pre_dynamic: have 23
debug2: channel 5: decode socks5
debug2: channel 5: socks5 post auth
debug2: channel 5: dynamic request: socks5 host ubuntuforums.com port 80 command 1
debug1: Connection to port 11323 forwarding to socks port 0 requested.
debug2: fd 12 setting TCP_NODELAY
debug2: fd 12 setting O_NONBLOCK
debug1: channel 6: new [dynamic-tcpip]
debug2: channel 6: pre_dynamic: have 0
debug2: channel 6: pre_dynamic: have 3
debug2: channel 6: decode socks5
debug2: channel 6: socks5 auth done
debug2: channel 6: pre_dynamic: need more
debug2: channel 6: pre_dynamic: have 0
debug2: channel 6: pre_dynamic: have 23
debug2: channel 6: decode socks5
debug2: channel 6: socks5 post auth
debug2: channel 6: dynamic request: socks5 host ubuntuforums.com port 80 command 1
channel 5: open failed: connect failed: Connection timed out
debug2: channel 5: zombie
debug2: channel 5: garbage collecting
debug1: channel 5: free: direct-tcpip: listening port 11323 for ubuntuforums.com port 80, connect from ::1 port 56088 to ::1 port 11323, nchannels 7
channel 6: open failed: connect failed: Connection timed out
debug2: channel 6: zombie
debug2: channel 6: garbage collecting
debug1: channel 6: free: direct-tcpip: listening port 11323 for   ubuntuforums.com port 80, connect from ::1 port 56090 to ::1 port 11323, nchannels 6

答案1

我是个白痴。我在我的服务器上设置了一些古怪的 iptables 规则。清除所有这些后,一切正常。抱歉打扰了。

相关内容