问题:

ssh连接服务器多次尝试密码后导致连接失败,ssh连接主机时出现:
ssh_exchange_identification: read: Connection reset,解决方法如下:


客户端连接服务端遭到拒绝:

[root@foundation66 ~]# ssh root@172.25.254.166
ssh_exchange_identification: read: Connection reset by peer

可以通过ssh -v查看连接时详情

-v表示查看连接详细信息
[root@foundation66 ~]# ssh -v root@172.25.254.166

在这里插入图片描述


解决方案:

在服务端更改配置文件,在最后追加 sshd: ALL

[root@localhost Desktop]# vi /etc/hosts.allow

sshd: ALL # 允许所有ip主机均能连接本机

在这里插入图片描述


之后重启ssh服务

[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


如有错误,欢迎私信纠正,谢谢支持!

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐