最近给软路由重装完固件连接时发现ssh报错,如下
C:\Users\yzh>ssh root@192.168.8.1
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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 ED25519 key sent by the remote host is
SHA256:uSgAcKy0NKevdMFprVPlHaajR6Bg.
Please contact your system administrator.
Add correct host key in C:\\Users\\yzh/.ssh/known_hosts to get rid of this message.
Offending ED25519 key in C:\\Users\\yzh/.ssh/known_hosts:5
ED25519 host key for 192.168.8.1 has changed and you have requested strict checking.
Host key verification failed.
WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!
警告:远程主机标识已更改!
这个报错主要是因为远程主机的ssh公钥发生了变化,两边不一致导致的
删除本地对应ip的在known_hosts相关信息
删除之后重新连接,成功!