在 Linux 上使用 SSH 隧道时出现错误。我收到“...bad id: ...Received ieof for nonexistent channel”错误

在 Linux 上使用 SSH 隧道时出现错误。我收到“...bad id: ...Received ieof for nonexistent channel”错误

每当我通过代理访问几个站点后,使用 ssh 命令在 Linux 上打开 SSH 隧道时,我都会收到此信息:channel_by_id:3:坏 id:通道可用断开连接:收到不存在的通道 3 的 ieof。

在 Windows 上,我使用的隧道软件只处理通道关闭并在必要时打开新的通道。有没有客户端或方法可以在 Linux 上执行此操作?我找到了一个名为 autossh 的程序,但每次重新连接时我都需要重新输入密码,因为它会重置整个连接而不仅仅是通道。

这是使用 -v 的 ssh 的输出

OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to <host> port 22.
debug1: Connection established.
debug1: identity file /home/user/.ssh/id_rsa type -1
debug1: identity file /home/user/.ssh/id_rsa-cert type -1
debug1: identity file /home/user/.ssh/id_dsa type -1
debug1: identity file /home/user/.ssh/id_dsa-cert type -1
debug1: identity file /home/user/.ssh/id_ecdsa type -1
debug1: identity file /home/user/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/user/.ssh/id_ed25519 type -1
debug1: identity file /home/user/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2
debug1: Remote protocol version 2.0, remote software version WeOnlyDo 2.1.3
debug1: no match: WeOnlyDo 2.1.3
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: sending SSH2_MSG_KEXDH_INIT
debug1: expecting SSH2_MSG_KEXDH_REPLY
debug1: Server host key: RSA key
debug1: Host '<host>' is known and matches the RSA host key.
debug1: Found key in /home/user/.ssh/known_hosts:1
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: password,publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /home/user/.ssh/id_rsa
debug1: Trying private key: /home/user/.ssh/id_dsa
debug1: Trying private key: /home/user/.ssh/id_ecdsa
debug1: Trying private key: /home/user/.ssh/id_ed25519
debug1: Next authentication method: password
User@host's password: 
debug1: Authentication succeeded (password).
Authenticated to <host>.
debug1: Local connections to LOCALHOST:1080 forwarded to remote address socks:0
debug1: Local forwarding listening on ::1 port 1080.
debug1: channel 0: new [port listener]
debug1: Local forwarding listening on 127.0.0.1 port 1080.
debug1: channel 1: new [port listener]
debug1: Entering interactive session.
debug1: Connection to port 1080 forwarding to socks port 0 requested.
debug1: channel 2: new [dynamic-tcpip]
debug1: Connection to port 1080 forwarding to socks port 0 requested.
debug1: channel 3: new [dynamic-tcpip]
debug1: Connection to port 1080 forwarding to socks port 0 requested.
debug1: channel 4: new [dynamic-tcpip]
debug1: Connection to port 1080 forwarding to socks port 0 requested.
debug1: channel 5: new [dynamic-tcpip]
debug1: Connection to port 1080 forwarding to socks port 0 requested.
debug1: channel 6: new [dynamic-tcpip]
debug1: Connection to port 1080 forwarding to socks port 0 requested.
debug1: channel 7: new [dynamic-tcpip]
debug1: Connection to port 1080 forwarding to socks port 0 requested.
debug1: channel 8: new [dynamic-tcpip]
debug1: Connection to port 1080 forwarding to socks port 0 requested.
debug1: channel 9: new [dynamic-tcpip]
debug1: Connection to port 1080 forwarding to socks port 0 requested.
debug1: channel 10: new [dynamic-tcpip]
debug1: Connection to port 1080 forwarding to socks port 0 requested.
debug1: channel 11: new [dynamic-tcpip]
debug1: Connection to port 1080 forwarding to socks port 0 requested.
debug1: channel 12: new [dynamic-tcpip]
debug1: Connection to port 1080 forwarding to socks port 0 requested.
debug1: channel 13: new [dynamic-tcpip]
debug1: Connection to port 1080 forwarding to socks port 0 requested.
debug1: channel 14: new [dynamic-tcpip]
debug1: Connection to port 1080 forwarding to socks port 0 requested.
debug1: channel 15: new [dynamic-tcpip]
debug1: Connection to port 1080 forwarding to socks port 0 requested.
debug1: channel 16: new [dynamic-tcpip]
debug1: Connection to port 1080 forwarding to socks port 0 requested.
debug1: channel 17: new [dynamic-tcpip]
debug1: Connection to port 1080 forwarding to socks port 0 requested.
debug1: channel 18: new [dynamic-tcpip]
debug1: Connection to port 1080 forwarding to socks port 0 requested.
debug1: channel 19: new [dynamic-tcpip]
debug1: Connection to port 1080 forwarding to socks port 0 requested.
debug1: channel 20: new [dynamic-tcpip]
debug1: Connection to port 1080 forwarding to socks port 0 requested.
debug1: channel 21: new [dynamic-tcpip]
debug1: Connection to port 1080 forwarding to socks port 0 requested.
debug1: channel 22: new [dynamic-tcpip]
debug1: Connection to port 1080 forwarding to socks port 0 requested.
debug1: channel 23: new [dynamic-tcpip]
debug1: Connection to port 1080 forwarding to socks port 0 requested.
debug1: channel 24: new [dynamic-tcpip]
debug1: Connection to port 1080 forwarding to socks port 0 requested.
debug1: channel 25: new [dynamic-tcpip]
debug1: Connection to port 1080 forwarding to socks port 0 requested.
debug1: channel 26: new [dynamic-tcpip]
debug1: Connection to port 1080 forwarding to socks port 0 requested.
debug1: channel 27: new [dynamic-tcpip]
debug1: Connection to port 1080 forwarding to socks port 0 requested.
debug1: channel 28: new [dynamic-tcpip]
debug1: Connection to port 1080 forwarding to socks port 0 requested.
debug1: channel 29: new [dynamic-tcpip]
debug1: Connection to port 1080 forwarding to socks port 0 requested.
debug1: channel 30: new [dynamic-tcpip]
debug1: Connection to port 1080 forwarding to socks port 0 requested.
debug1: channel 31: new [dynamic-tcpip]
debug1: Connection to port 1080 forwarding to socks port 0 requested.
debug1: channel 32: new [dynamic-tcpip]
debug1: Connection to port 1080 forwarding to socks port 0 requested.
debug1: channel 33: new [dynamic-tcpip]
debug1: Connection to port 1080 forwarding to socks port 0 requested.
debug1: channel 34: new [dynamic-tcpip]
debug1: channel 10: free: direct-tcpip: listening port 1080 for connect.facebook.net port 80, connect from 127.0.0.1 port 51036 to 127.0.0.1 port 1080, nchannels 35
debug1: Connection to port 1080 forwarding to socks port 0 requested.
debug1: channel 10: new [dynamic-tcpip]
debug1: channel 11: free: direct-tcpip: listening port 1080 for connect.facebook.net port 80, connect from 127.0.0.1 port 51037 to 127.0.0.1 port 1080, nchannels 35
debug1: Connection to port 1080 forwarding to socks port 0 requested.
debug1: channel 11: new [dynamic-tcpip]
debug1: channel 33: free: direct-tcpip: listening port 1080 for cdn.syndication.twitter.com port 80, connect from 127.0.0.1 port 51059 to 127.0.0.1 port 1080, nchannels 35
debug1: Connection to port 1080 forwarding to socks port 0 requested.
debug1: channel 33: new [dynamic-tcpip]
debug1: client_input_channel_req: channel 10 rtype exit-status reply 0
debug1: client_input_channel_req: no sink for exit-status on channel 10
debug1: channel 10: free: direct-tcpip: listening port 1080 for webchat.freenode.net port 80, connect from 127.0.0.1 port 51061 to 127.0.0.1 port 1080, nchannels 35
channel_by_id: 10: bad id: channel free
Disconnecting: Received ieof for nonexistent channel 10.

答案1

事实证明,我使用的服务器违反了 SSH 协议,只需更改服务器软件就可以修复它。

由 BARLOP 添加(来自 OP 的评论 - 服务器软件是 freesshd)

答案2

当我在 Windows 10 上打开开发人员模式时,我遇到了这个问题,它启动了 Windows 原生 SSH 服务器,而不是预期的 OpenSSH 服务器。通常,请检查您尝试登录的 ssh 守护程序。

相关内容