2018/08/27

在Chrome的Secure Shell中清除known_hosts

最近频繁在一个Raspberry Pi上插入不同的TF卡,运行不同的Raspbian,然后从办公用电脑的Chrome用Secure Shell连接Raspbian,导致其保存的known_hosts混乱,无法连接,错误如下:
 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 @    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:po6Fye+CR7Xw7DUrF7jsk8EKYF21utA4733iaGa2yjs.
 Please contact your system administrator.
 Add correct host key in /.ssh/known_hosts to get rid of this message.
 Offending ECDSA key in /.ssh/known_hosts:17
 ECDSA host key for 192.168.3.166 has changed and you have requested strict checking.
 Host key verification failed.
 NaCl 插件已退出,状态代码为:255。
 重新连接(R)、选择其他连接(C)或退出(E)
处理方法是,在错误界面上同时按 CTRL +Shift +J,以进入JavaScript console,在窗口左下角点击“console“,录入以下命令并回车:
term_.command.removeKnownHostByIndex(17);
注意上面这个“17”是我的错误提示中的Index,请替换成你自己的。
回车后,虽然Console反馈undefined, 但其实已经成功了,关闭Console,再重新连接你的host即可。

没有评论: