SSH 错误 kex_exchange_identification:读取:连接被对等方重置

SSH 错误 kex_exchange_identification:读取:连接被对等方重置

当我从树莓派 ssh 进入 wsl2 时遇到问题。

我在 Windows 计算机上创建了规则,将端口 2222 转发到 wsl2,并设置了入站防火墙规则以允许端口 2222 上的流量。

这是我运行此命令时 ssh 调试的输出

ssh riccardoob@[windows ip] -p 2222 -vvv

OpenSSH_8.4p1 Ubuntu-5ubuntu1.1, OpenSSL 1.1.1j  16 Feb 2021
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/home/ubuntu/.ssh/known_hosts'
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/home/ubuntu/.ssh/known_hosts2'
debug2: resolving "[domain name]" port 2222
debug2: ssh_connect_direct
debug1: Connecting to [domain name] [ip] port 2222.
debug1: Connection established.
debug1: identity file /home/ubuntu/.ssh/id_rsa type -1
debug1: identity file /home/ubuntu/.ssh/id_rsa-cert type -1
debug1: identity file /home/ubuntu/.ssh/id_dsa type -1
debug1: identity file /home/ubuntu/.ssh/id_dsa-cert type -1
debug1: identity file /home/ubuntu/.ssh/id_ecdsa type -1
debug1: identity file /home/ubuntu/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/ubuntu/.ssh/id_ecdsa_sk type -1
debug1: identity file /home/ubuntu/.ssh/id_ecdsa_sk-cert type -1
debug1: identity file /home/ubuntu/.ssh/id_ed25519 type -1
debug1: identity file /home/ubuntu/.ssh/id_ed25519-cert type -1
debug1: identity file /home/ubuntu/.ssh/id_ed25519_sk type -1
debug1: identity file /home/ubuntu/.ssh/id_ed25519_sk-cert type -1
debug1: identity file /home/ubuntu/.ssh/id_xmss type -1
debug1: identity file /home/ubuntu/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.4p1 Ubuntu-5ubuntu1.1
kex_exchange_identification: read: Connection reset by peer
Connection reset by [ip] port 2222

让我失望的是连接已正确建立并且服务器已正确设置。我必须指定我能够从同一个树莓派 ssh 进入 wsl,但突然间这个错误开始出现,不幸的是我无法确定自上次成功连接以来我做了什么。

请询问是否需要更多信息才能最好地调试此问题。

编辑:我尝试从 wsl 连接到的网络外部进行尝试,正如我在此处找到的线程所建议的那样,但我收到了类似的错误:

ssh_exchange_error: connection closed by peer

相关内容