报错如下:
ssh_exchange_identification: read: Connection reset by peer
lost connection
问题原因
该问题通常是由于 Linux 系统通过 /etc/hosts.allow 或 /etc/hosts.deny,启用了 TCP Wrapper 访问控制所致。
处理办法
要解决此问题,请进行如下配置检查和修改:
通过 管理终端 进入系统。
通过 cat 等指令查看 /etc/hosts.allow 或 /etc/hosts.deny中是否包含类似如下配置:
all:all:deny
如果需要修改相关策略配置,在继续之前建议进行文件备份。
使用 vi 等编辑器,按需修改 /etc/hosts.allow 和 /etc/hosts.deny中的相关配置,或者整个删除或注释(在最开头添加 # 号)整行配置。比如:
all:all:deny
vi /etc/hosts.allow
其他全部注释,追加:
sshd: ALL
重启ssh就ok了
service sshd restart (centos6)
systemctl restart sshd (centos7)
本文详细解析了Linux系统中出现的SSH连接丢失错误,通常由TCPWrapper访问控制引起。介绍了如何通过修改/etc/hosts.allow和/etc/hosts.deny文件来解决这一问题,包括配置检查、文件备份、修改策略及重启SSH服务的步骤。

7236

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



