ssh连接主机时,出现如下报错如何解决?
在客户端连接服务端:
[root@foundation66 ~]# ssh root@172.25.254.166
ssh_exchange_identification: read: Connection reset by peer
## -v表示查看连接详细信息
[root@foundation66 ~]# ssh -v root@172.25.254.166

解决方案:在服务端更改配置文件
[root@localhost Desktop]# vi /etc/hosts.allow
#########################
sshd: ALL ##允许所有ip主机均能连接本机

[root@localhost Desktop]# systemctl restart sshd
测试:
[root@foundation66 ~]# ssh root@172.25.254.166
Last login: Wed Jan 9 22:51:17 2019 from 172.25.254.66
本文介绍了一种常见的SSH连接错误及其解决方案。当遇到“ssh_exchange_identification:read:Connection reset by peer”错误时,可以通过修改服务端的配置文件/etc/hosts.allow来允许特定IP或所有IP连接,重启sshd服务后即可恢复正常连接。

11万+

被折叠的 条评论
为什么被折叠?



