博主头像
qzmer2

个人小站,不定时记录技术与生活所感,愿得你流连,感三生有幸。

  • 累计撰写 30 篇文章
  • 累计创建 59 个标签

目录

linux

关于使用过公钥登录ecs后,再更换成root登录后连接的问题

登录一直报以下错误 spawn ssh -o StrictHostKeyChecking=no root@8.210.253.233 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: REMOTE HOST

  • 2857 次阅读
  • 阅读时长

登录一直报以下错误

spawn ssh -o StrictHostKeyChecking=no root@8.210.253.233
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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:LELLcDG55ebYMwIVRaqL7T+GZrBgHLBMKvnA2deCR0M.
Please contact your system administrator.
Add correct host key in /Users/xxx/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /Users/xxx/.ssh/known_hosts:63
Password authentication is disabled to avoid man-in-the-middle attacks.
Keyboard-interactive authentication is disabled to avoid man-in-the-middle attacks.
root@8.210.253.233: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).

一直在处理服务器的know_hosts文件,后来发现需要替换本机的。
使用以下命令即可

ssh-keygen -f ~/.ssh/known_hosts -R 服务器ip

理解为电脑其实对host有缓存,删除之后重新连接即可。

最后更新于 2020-12-03

评论区

加载中…