当咱们使用ssh root@ip登陆Linux服务器时,服务器报错:缓存
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ 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:NUY6we/C7Gn1z9Wws0ttHJA7hBhTg8mFoDIh2Z72wGU. Please contact your system administrator. Add correct host key in /home/keytech/.ssh/known_hosts to get rid of this message. Offending ECDSA key in /home/keytech/.ssh/known_hosts:8 remove with: ssh-keygen -f "/home/keytech/.ssh/known_hosts" -R 112.x2x.xx.xx ECDSA host key for 112.x2x.xx.xx has changed and you have requested strict checking. Host key verification failed.
如何解决?缘由分析:服务器
这是因为,ssh链接服务器时,若是以前链接过,ssh会默认保存该ip的链接协议信息,当咱们再次访问此ip服务器时,ssh会自动匹配以前ssh保存的信息,因为咱们的服务器作了更改,例如重装系统等操做,会致使本地保存的ssh信息失效,因而再次链接时就会出现上述错误。ssh
另外,远程服务器的ssh服务被卸载重装或ssh相关数据(协议信息)被删除也会致使这个错误。ide
解决方案:this
删除本地known_hosts里面的缓存信息便可。`命令:ssh-keygen -R "你的远程服务器ip地址" ```code
注意:R是大写ip