[外链图片转存失败(img-ekE3oGf7-1564713340926)(evernotecid://D7D93712-3C2E-4EC3-AA0B-D1A7842C2B81/appyinxiangcom/21861001/ENResource/p263)]
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
SHA256:KiHNyOpWDO1oaK2wmc4sEw596cd7VEy7ayEMx6od9RA.
Please contact your system administrator.
Add correct host key in /Users/huwq_galaxy/.ssh/known_hosts to get rid of this message.
Offending RSA key in /Users/huwq_galaxy/.ssh/known_hosts:6
RSA host key for 172.16.112.51 has changed and you have requested strict checking.
Host key verification failed.
经过google,出现这个问题的原因是,第一次使用SSH连接时,会生成一个认证,储存在客户端的known_hosts中。
可使用以下指令查看:
ssh-keygen -l -f ~/.ssh/known_hosts
由于服务器重新安装系统了,所以会出现以上错误。
解决办法
ssh-keygen -R 服务器端的ip地址
会出现以下提示:
# Host 172.16.112.51 found: line 6
/Users/huwq_galaxy/.ssh/known_hosts updated.
Original contents retained as /Users/huwq_galaxy/.ssh/known_hosts.old
重新连线,出现以下提示:
huweiqindeMacBook-Pro:~ huwq_galaxy$ ssh root@ip地址
The authenticity of host 'ip地址 (ip地址)' can't be established.
RSA key fingerprint is SHA256:balabala.
Are you sure you want to continue connecting (yes/no)? yes
输入yes确认即可连线成功。