无法通过 SSH 连接到任何服务器

无法通过 SSH 连接到任何服务器

有一天我无法通过 SSH 登录到我的服务器。使用 Putty 和 MobaXterm。MobaXterm 结束时显示:

debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
Read from socket failed: Software caused connection abort

我搜索了该问题并发现这可能是 MTU 特定的问题,但是怎么可能突然无法登录不同的服务器呢?

-v这是我启用调试的连接会话之一:

OpenSSH_6.7p1, OpenSSL 1.0.1g 7 Apr 2014
debug1: Reading configuration data /etc/ssh_config
debug1: Connecting to XXX.XXX.XXX.XXX [XXX.XXX.XXX.XXX] port 22.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file /var/keys/.5380.ssh type -1
debug1: key_load_public: No such file or directory
debug1: identity file /var/keys/.5380.ssh-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.7
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.0p1 Debian-4+deb7u2
debug1: match: OpenSSH_6.0p1 Debian-4+deb7u2 pat OpenSSH* compat 0x04000000
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr [email protected] [email protected]
debug1: kex: client->server aes128-ctr [email protected] [email protected]
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY

它挂在这一行并在几秒后结束:

Read from socket failed: Software caused connection abort

我非常感谢您的帮助。

答案1

看起来您在服务器/客户端上遇到了 ssh 密钥问题...请查看https://askubuntu.com/questions/205179/ssh-problem-read-from-socket-failed-connection-reset-by-peer (错误略有不同,但大多数套接字错误的故障排除方式都类似。)

并且当您尝试从笔记本电脑/台式机连接时清除已知主机文件,例如 MobaXterm,您必须导航到 /home/mobaxterm/.ssh/known_hosts 并删除现有条目。对于 putty,请检查此https://superuser.com/questions/197489/where-does-putty-store-known-hosts-information-on-windows

相关内容