Linux ssh:handshake failed:EOF

一、前沿

1、Notes:以下操作均在 京东云服务器
2、在配置好免密登陆之后,通过ssh登陆的时候间接性的遇见 ssh:handshake failed:EOF 真是让人恼火,所以给总结一下。

二、解决步骤

1、查看原因

1、 -v 表示查看连接详细信息

1、ssh -v root@192.168.1.9

OpenSSH_7.4p1, OpenSSL 1.0.2k-fips  26 Jan 2017
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 58: Applying options for *
debug1: Connecting to 192.168.1.9 [192.168.1.9] port 22.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: identity file /root/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_dsa-cert type -1

2、解决方案

1、在服务端更改配置文件

1、vi /etc/hosts.allow
# hosts.allow   This file contains access rules which are used to
#               allow or deny connections to network services that
#               either use the tcp_wrappers library or that have been
#               started through a tcp_wrappers-enabled xinetd.
#
#               See 'man 5 hosts_options' and 'man 5 hosts_access'
#               for information on rule syntax.
#               See 'man tcpd' for information on tcp_wrappers
#
sshd: ALL  # 添加允许所有ip主机均能连接本机

2、重启sshd服务

1、systemctl restart sshd

三、总结

简单记录一下,如果对你无用,请查找其他方法。

上一篇:批量实现SSH免密登录


下一篇:zookeeper客户端连接bug