阿里云服务器ssh_exchange_identification: read: Connection reset by peer

阿里云服务器SSH连接提示ssh_exchange_identification: read: Connection reset by peer,如何解决?SSH登录提示kex_exchange_identification应该是内核拒绝了ssh连接,云服务器吧分享解决方法:

ssh_exchange_identification: read: Connection reset by peer

阿里云服务器SSH远程连接提示“ssh_exchange_identification: read: Connection reset by peer”,如何解决?云服务器吧建议使用阿里云服务器ECS控制台自带的远程连接工具,如下图:

阿里云服务器远程连接

阿里云服务器远程连接

使用自带远程连接工具,一般可以解决问题。

也可以执行命令:ssh-keygen -R IP地址,清除known_hosts文件主机名密匙。

或执行命令:ssh -v root@IP地址,查看连接详细信息,如下图:

ssh -v root@IP地址

ssh -v root@IP地址

然后执行命令:vi /etc/hosts.allow,按字母i,进入vi编辑模式,添加sshd: ALL,允许所有IP地址链接主机。
如下图:

sshd: ALL

sshd: ALL

执行命令:systemctl restart sshd,重启sshd服务即可。

最后执行SSH连接命令:ssh root@IP地址,重新测试一下吧。