macbook通过秘钥对登录腾讯云服务器报错
上周的时候,我将自己的腾讯云服务器重新安装系统和相关软件,并且重新生成了秘钥对。今天我通过秘钥登录服务器的时候报这个错误。
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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:BySP03gaaaaaaaaaaaaaaieajBNDEFx//hc3Po.
Please contact your system administrator.
Add correct host key in /Users/zl/.ssh/known_hosts to get rid of this message.
Offending RSA key in /Users/zl/.ssh/known_hosts:7
RSA host key for 111.11.111.111 has changed and you have requested strict checking.
Host key verification failed.
其实定位的问题就是切换目录到~/.ssh下的hnown_host文件,里面配置了我这台服务器的公钥,因为上周我重新生成了秘钥对,导致本次登录始终验证失败。
所以vi known_host,然后找到你的这台服务器对应的ip ,将哪行数据删除,然后重新验证即可。
登录服务器看着两篇文章即可。
macbook 配置ssk-key