一、问题
Hadoop启动时报错localhost: ssh_exchange_identification: read: Connection reset by peer
二、解决措施
(一)CSDN博客上说可以在/etc/hosts.allow文件里追加sshd: ALL,然后重启ssh服务
[root@hurys24 ~]# vi /etc/hosts.allow
然后重启ssh服务systemctl restart sshd
[root@hurys24 ~]# systemctl restart sshd
结果遇到新的报错
Permissions 0715 for /etc/ssh/ssh_host_rsa_key are too open.
(二)文件权限问题,修改文件权限,然后重启ssh服务
[root@hurys24 ~] /usr/sbin/sshd -T
[root@hurys24 ~] chmod 600 /etc/ssh/ssh_host_rsa_key
[root@hurys24 ~] chmod 600 /etc/ssh/ssh_host_ecdsa_key
[root@hurys24 ~] chmod 600 /etc/ssh/ssh_host_ed25519_key
[root@hurys24 ~] systemctl restart sshd
结果启动Hadoop后又遇到问题,Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password)
(三)最后,卸载ssh,重新下载ssh
1.卸载ssh
[root@hurys24 ~] rm -rf .ssh/
2.下载ssh
[root@hurys24 ~] ssh-keygen -t rsa -P ""
[root@hurys24 ~] cd
[root@hurys24 ~] cd .ssh/
[root@hurys24 ~] ls
[root@hurys24 ~] cat id_rsa.pub
[root@hurys24 ~] cd
[root@hurys24 ~] ssh-copy-id -i .ssh/id_rsa.pub -p22 root@192.168.0.24
[root@hurys24 ~] ssh -p22 root@192.168.0.24
[root@hurys24 ~] ssh -p22 root@hurys24
3.然后启动Hadoop,成功
[root@hurys24 ~] start-all.sh