SSH 通道 3:隧道连接被拒绝

SSH 通道 3:隧道连接被拒绝

我尝试通过 ssh 隧道使用一些游戏、Discord。因此,我使用 ssh 通过 socks 协议创建了隧道:

sudo ssh -D 4343 -p 443 164.**.**.41 -v

如果我通过在设置中配置代理来使用 Firefox,它就可以正常工作。但要运行任何程序,例如 Dofus,我使用 proxychains-nghttps://github.com/rofl0r/proxychains-ng

sudo proxychains4 -f ~/.proxychains.conf ~/games/Dofus/Dofus 

游戏开始了,但同时在服务器上我有以下几行:

debug1: Connection to port 4343 forwarding to socks port 0 requested.
debug1: channel 3: new [dynamic-tcpip]
debug1: Connection to port 4343 forwarding to socks port 0 requested.
debug1: channel 4: new [dynamic-tcpip]
channel 3: open failed: connect failed: Connection refused
debug1: channel 3: free: direct-tcpip: listening port 4343 for 127.0.0.1 port 4343, connect from 127.0.0.1 port 34692 to 127.0.0.1 port 4343, nchannels 5
debug1: Connection to port 4343 forwarding to socks port 0 requested.
debug1: channel 3: new [dynamic-tcpip]
channel 4: open failed: connect failed: Connection refused
debug1: channel 4: free: direct-tcpip: listening port 4343 for 127.0.0.1 port 4343, connect from 127.0.0.1 port 34694 to 127.0.0.1 port 4343, nchannels 5
debug1: Connection to port 4343 forwarding to socks port 0 requested.
debug1: channel 4: new [dynamic-tcpip]
channel 3: open failed: connect failed: Connection refused
channel 4: open failed: connect failed: Connection refused
debug1: channel 3: free: direct-tcpip: listening port 4343 for 127.0.0.1 port 4343, connect from 127.0.0.1 port 34696 to 127.0.0.1 port 4343, nchannels 5
debug1: channel 4: free: direct-tcpip: listening port 4343 for 127.0.0.1 port 4343, connect from 127.0.0.1 port 34698 to 127.0.0.1 port 4343, nchannels 4
debug1: Connection to port 4343 forwarding to socks port 0 requested.
debug1: channel 3: new [dynamic-tcpip]
channel 3: open failed: connect failed: Connection refused
debug1: channel 3: free: direct-tcpip: listening port 4343 for 127.0.0.1 port 4343, connect from 127.0.0.1 port 34700 to 127.0.0.1 port 4343, nchannels 4
debug1: Connection to port 4343 forwarding to socks port 0 requested.
debug1: channel 3: new [dynamic-tcpip]
channel 3: open failed: connect failed: Connection refused
debug1: channel 3: free: direct-tcpip: listening port 4343 for 127.0.0.1 port 4343, connect from 127.0.0.1 port 34702 to 127.0.0.1 port 4343, nchannels 4
debug1: Connection to port 4343 forwarding to socks port 0 requested.
debug1: channel 3: new [dynamic-tcpip]
debug1: Connection to port 4343 forwarding to socks port 0 requested.
debug1: channel 4: new [dynamic-tcpip]
channel 3: open failed: connect failed: Connection refused
debug1: channel 3: free: direct-tcpip: listening port 4343 for 127.0.0.1 port 4343, connect from 127.0.0.1 port 34704 to 127.0.0.1 port 4343, nchannels 5
debug1: Connection to port 4343 forwarding to socks port 0 requested.
debug1: channel 3: new [dynamic-tcpip]
channel 4: open failed: connect failed: Connection refused
debug1: channel 4: free: direct-tcpip: listening port 4343 for 127.0.0.1 port 4343, connect from 127.0.0.1 port 34706 to 127.0.0.1 port 4343, nchannels 5
debug1: Connection to port 4343 forwarding to socks port 0 requested.
debug1: channel 4: new [dynamic-tcpip]
channel 3: open failed: connect failed: Connection refused
debug1: channel 3: free: direct-tcpip: listening port 4343 for 127.0.0.1 port 4343, connect from 127.0.0.1 port 34708 to 127.0.0.1 port 4343, nchannels 5
debug1: Connection to port 4343 forwarding to socks port 0 requested.
debug1: channel 3: new [dynamic-tcpip]
channel 4: open failed: connect failed: Connection refused
debug1: channel 4: free: direct-tcpip: listening port 4343 for 127.0.0.1 port 4343, connect from 127.0.0.1 port 34710 to 127.0.0.1 port 4343, nchannels 5
debug1: Connection to port 4343 forwarding to socks port 0 requested.
debug1: channel 4: new [dynamic-tcpip]
channel 3: open failed: connect failed: Connection refused
debug1: channel 3: free: direct-tcpip: listening port 4343 for 127.0.0.1 port 4343, connect from 127.0.0.1 port 34712 to 127.0.0.1 port 4343, nchannels 5
debug1: Connection to port 4343 forwarding to socks port 0 requested.
debug1: channel 3: new [dynamic-tcpip]
channel 4: open failed: connect failed: Connection refused
channel 3: open failed: connect failed: Connection refused
debug1: channel 3: free: direct-tcpip: listening port 4343 for 127.0.0.1 port 4343, connect from 127.0.0.1 port 34716 to 127.0.0.1 port 4343, nchannels 5
debug1: channel 4: free: direct-tcpip: listening port 4343 for 127.0.0.1 port 4343, connect from 127.0.0.1 port 34714 to 127.0.0.1 port 4343, nchannels 4
debug1: Connection to port 4343 forwarding to socks port 0 requested.
debug1: channel 3: new [dynamic-tcpip]
debug1: Connection to port 4343 forwarding to socks port 0 requested.
debug1: channel 4: new [dynamic-tcpip]
channel 3: open failed: connect failed: Connection refused
channel 4: open failed: connect failed: Connection refused
debug1: channel 3: free: direct-tcpip: listening port 4343 for 127.0.0.1 port 4343, connect from 127.0.0.1 port 34718 to 127.0.0.1 port 4343, nchannels 5
debug1: channel 4: free: direct-tcpip: listening port 4343 for 127.0.0.1 port 4343, connect from 127.0.0.1 port 34720 to 127.0.0.1 port 4343, nchannels 4
debug1: Connection to port 4343 forwarding to socks port 0 requested.
debug1: channel 3: new [dynamic-tcpip]
channel 3: open failed: connect failed: Connection refused
debug1: channel 3: free: direct-tcpip: listening port 4343 for 127.0.0.1 port 4343, connect from 127.0.0.1 port 34722 to 127.0.0.1 port 4343, nchannels 4
debug1: Connection to port 4343 forwarding to socks port 0 requested.
debug1: channel 3: new [dynamic-tcpip]
channel 3: open failed: connect failed: Connection refused
debug1: channel 3: free: direct-tcpip: listening port 4343 for 127.0.0.1 port 4343, connect from 127.0.0.1 port 34724 to 127.0.0.1 port 4343, nchannels 4
debug1: Connection to port 4343 forwarding to socks port 0 requested.
debug1: channel 3: new [dynamic-tcpip]
channel 3: open failed: connect failed: Connection refused
debug1: channel 3: free: direct-tcpip: listening port 4343 for 127.0.0.1 port 4343, connect from 127.0.0.1 port 34726 to 127.0.0.1 port 4343, nchannels 4
debug1: Connection to port 4343 forwarding to socks port 0 requested.
debug1: channel 3: new [dynamic-tcpip]
channel 3: open failed: connect failed: Connection refused
debug1: channel 3: free: direct-tcpip: listening port 4343 for 127.0.0.1 port 4343, connect from 127.0.0.1 port 34728 to 127.0.0.1 port 4343, nchannels 4
debug1: Connection to port 4343 forwarding to socks port 0 requested.
debug1: channel 3: new [dynamic-tcpip]
channel 3: open failed: connect failed: Connection refused
debug1: channel 3: free: direct-tcpip: listening port 4343 for 127.0.0.1 port 4343, connect from 127.0.0.1 port 34730 to 127.0.0.1 port 4343, nchannels 4
debug1: Connection to port 4343 forwarding to socks port 0 requested.
debug1: channel 3: new [dynamic-tcpip]
channel 3: open failed: connect failed: Connection refused
debug1: channel 3: free: direct-tcpip: listening port 4343 for 127.0.0.1 port 4343, connect from 127.0.0.1 port 34732 to 127.0.0.1 port 4343, nchannels 4
debug1: Connection to port 4343 forwarding to socks port 0 requested.
debug1: channel 3: new [dynamic-tcpip]
channel 3: open failed: connect failed: Connection refused
debug1: channel 3: free: direct-tcpip: listening port 4343 for 127.0.0.1 port 4343, connect from 127.0.0.1 port 34734 to 127.0.0.1 port 4343, nchannels 4
debug1: Connection to port 4343 forwarding to socks port 0 requested.
debug1: channel 3: new [dynamic-tcpip]
channel 3: open failed: connect failed: Connection refused
debug1: channel 3: free: direct-tcpip: listening port 4343 for 127.0.0.1 port 4343, connect from 127.0.0.1 port 34736 to 127.0.0.1 port 4343, nchannels 4
debug1: Connection to port 4343 forwarding to socks port 0 requested.
debug1: channel 3: new [dynamic-tcpip]
channel 3: open failed: connect failed: Connection refused
debug1: channel 3: free: direct-tcpip: listening port 4343 for 127.0.0.1 port 4343, connect from 127.0.0.1 port 34738 to 127.0.0.1 port 4343, nchannels 4
debug1: Connection to port 4343 forwarding to socks port 0 requested.
debug1: channel 3: new [dynamic-tcpip]
channel 3: open failed: connect failed: Connection refused
debug1: channel 3: free: direct-tcpip: listening port 4343 for 127.0.0.1 port 4343, connect from 127.0.0.1 port 34740 to 127.0.0.1 port 4343, nchannels 4
debug1: Connection to port 4343 forwarding to socks port 0 requested.
debug1: channel 3: new [dynamic-tcpip]
channel 3: open failed: connect failed: Connection refused
debug1: channel 3: free: direct-tcpip: listening port 4343 for 127.0.0.1 port 4343, connect from 127.0.0.1 port 34742 to 127.0.0.1 port 4343, nchannels 4
debug1: Connection to port 4343 forwarding to socks port 0 requested.
debug1: channel 3: new [dynamic-tcpip]
channel 3: open failed: connect failed: Connection refused
debug1: channel 3: free: direct-tcpip: listening port 4343 for 127.0.0.1 port 4343, connect from 127.0.0.1 port 34744 to 127.0.0.1 port 4343, nchannels 4
debug1: Connection to port 4343 forwarding to socks port 0 requested.
debug1: channel 3: new [dynamic-tcpip]
channel 3: open failed: connect failed: Connection refused
debug1: channel 3: free: direct-tcpip: listening port 4343 for 127.0.0.1 port 4343, connect from 127.0.0.1 port 34746 to 127.0.0.1 port 4343, nchannels 4
debug1: Connection to port 4343 forwarding to socks port 0 requested.
debug1: channel 3: new [dynamic-tcpip]
channel 3: open failed: connect failed: Connection refused
debug1: channel 3: free: direct-tcpip: listening port 4343 for 127.0.0.1 port 4343, connect from 127.0.0.1 port 34748 to 127.0.0.1 port 4343, nchannels 4
debug1: Connection to port 4343 forwarding to socks port 0 requested.
debug1: channel 3: new [dynamic-tcpip]
channel 3: open failed: connect failed: Connection refused
debug1: channel 3: free: direct-tcpip: listening port 4343 for 127.0.0.1 port 4343, connect from 127.0.0.1 port 34750 to 127.0.0.1 port 4343, nchannels 4
debug1: Connection to port 4343 forwarding to socks port 0 requested.
debug1: channel 3: new [dynamic-tcpip]
channel 3: open failed: connect failed: Connection refused
debug1: channel 3: free: direct-tcpip: listening port 4343 for 127.0.0.1 port 4343, connect from 127.0.0.1 port 34752 to 127.0.0.1 port 4343, nchannels 4
debug1: Connection to port 4343 forwarding to socks port 0 requested.
debug1: channel 3: new [dynamic-tcpip]
channel 3: open failed: connect failed: Connection refused
debug1: channel 3: free: direct-tcpip: listening port 4343 for 127.0.0.1 port 4343, connect from 127.0.0.1 port 34754 to 127.0.0.1 port 4343, nchannels 4

我检查了 AllowTcpForwarding 是否已启用,并且已启用。

grep Forwarding /etc/ssh/sshd_config 
X11Forwarding yes
AllowTcpForwarding yes

我不知道该怎么做,我想我必须打开或通过 iptables 转发某些东西,但我不知道该怎么做。而且我不想为每个程序打开每个端口。

提前感谢您的回答。

相关内容