使用SSH登入時如果遇到下列錯誤訊息,可以使用ssh-keygen -R xxx.xxx.xxx.xxx 將本地端(自己電腦上)ssh key清除即可。
錯誤訊息
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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:TtveiplpmqTIQWoWXbPgKtBn/Eq3vylNtbQBqtisHEo.
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:28
ECDSA host key for xxx.xxx.xxx.xxx has changed and you have requested strict checking.
Host key verification failed.
解決方法:使用下列指令將 xxx.xxx.xxx.xxx 改成 有問題遠端IP
ssh-keygen -R xxx.xxx.xxx.xxx