网络 – ssh隧道拒绝与“通道2:打开失败”的连接

突然之间(读:不改变任何参数)我的netbsd虚拟机开始表现得很奇怪.症状涉及ssh隧道.

从我的笔记本电脑开始:

$ssh -L 7000:localhost:7000 user@host -N -v

然后,在另一个shell中:

$irssi -c localhost -p 7000

ssh调试说:

debug1: Connection to port 7000 forwarding to localhost port 7000 requested.
debug1: channel 2: new [direct-tcpip]
channel 2: open failed: connect failed: Connection refused
debug1: channel 2: free: direct-tcpip: listening port 7000 for localhost port 7000, connect from 127.0.0.1 port 53954, nchannels 3

我还尝试使用localhost:80连接到(远程)Web服务器,结果相同.

远程主机运行NetBSD:

bash-4.2# uname -a
NetBSD host 5.1_STABLE NetBSD 5.1_STABLE (XEN3PAE_DOMU) #6: Fri Nov  4 16:56:31 MET 2011  root@youll-thank-me-later:/m/obj/m/src/sys/arch/i386/compile/XEN3PAE_DOMU i386

我有点迷茫.我尝试在远程主机上运行tcpdump,我发现了这些’坏的chksum’:

09:25:55.823849 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 67, bad cksum 0 (->3cb3)!) 127.0.0.1.54381 > 127.0.0.1.7000: P, cksum 0xfe37 (incorrect (-> 0xa801), 1622402406:1622402421(15) ack 1635127887 win 4096 <nop,nop,timestamp 5002727 5002603>

我尝试重启ssh守护进程无济于事.我还没有重新启动 – 也许这里有人可以建议其他诊断.我认为它可能是虚拟网卡驱动程序,或者是根据我们的ssh.

想法..?

最佳答案
问题解决了:

$ssh -L 7000:127.0.0.1:7000 user@host -N -v -v

……显然,远程主机不喜欢’localhost’.然而,远程/ etc / hosts包含:

::1                     localhost localhost.
127.0.0.1               localhost localhost.

而本地网络接口是

lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 33184
        inet 127.0.0.1 netmask 0xff000000
        inet6 ::1 prefixlen 128
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2

叹.对于100rp的赏金,我穿上了:)

转载注明原文:网络 – ssh隧道拒绝与“通道2:打开失败”的连接 - 代码日志