Error:
[centos@s200 hadoop]$ ssh localhost
The authenticity of host ‘localhost (::1)’ can’t be established.
ECDSA key fingerprint is b7:a7:1d:80:34:67:c6:1e:a2:ac:8e:67:a5:38:38:d0.
Are you sure you want to continue connecting (yes/no)? 1
Please type ‘yes’ or ‘no’: yes
Warning: Permanently added ‘localhost’ (ECDSA) to the list of known hosts.
Write failed: Broken pipe
Fix it:
ssh -o StrictHostKeyChecking=no 192.168.xxx.xxx
方法二
一个彻底去掉这个提示的方法是,修改/etc/ssh/ssh_config文件(或$HOME/.ssh/config)中的配置,添加如下两行配置:
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
修改好配置后,重新启动sshd服务即可。
centos7重启ssh服务命令为systemctl restart sshd.service