问题详情:
gzucm04 20:28:52 ~
$ scp -r /home/gzucm04/project/ zhou1314@10.5.84.188:/home/zhou1314
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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 ECDSA key sent by the remote host is
SHA256:6+f0ZJMFMGmafdXesz/i7IQbW7edQ05Q7koXNsBnjQg.
Please contact your system administrator.
Add correct host key in /home/gzucm04/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /home/gzucm04/.ssh/known_hosts:2
remove with:
ssh-keygen -f "/home/gzucm04/.ssh/known_hosts" -R "10.5.84.188"
ECDSA host key for 10.5.84.188 has changed and you have requested strict checking.
Host key verification failed.
lost connection
原因:
因为服务器的ip发生变更了
第一次SSH连接时,会生成一个认证,储存在客户端(也就是用SSH连线其他电脑的那个,自己操作的那个)中的known_hosts,但是如果服务器验证过了,认证资讯当然也会更改,服务器端与客户端不同时,就会跳出错误啦。
解决办法:
方法一:
输入命令:ssh-keygen -R +输入服务器的IP
如:ssh-keygen -R 192.168.198.147
方法二:
rm ~/.ssh/known_hosts
网友评论