Linux SSH 遠程登錄錯誤解決辦法 WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!
最近在登錄一台機器的時候,發現無法等入了,出現以下錯誤

原來known_hosts是記錄遠程主機的公鑰的文件,之前重裝個系統,而保存的公鑰還是未重裝系統的系統公鑰,在ssh鏈接的時候首先會驗證公鑰,如果公鑰不對,那么就會報錯.
使用shh-keygen 命令
wljdeMacBook-Pro:~ wlj$ ssh root@47.**.***.*** @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ 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:n9HdR0qHesf7Nx+D729TW47QZ9rdz8uDAwNlJQnMzeU. Please contact your system administrator. Add correct host key in /Users/wlj/.ssh/known_hosts to get rid of this message. Offending ECDSA key in /Users/wlj/.ssh/known_hosts:1 ECDSA host key for 47.**.***.*** has changed and you have requested strict checking. Host key verification failed. wljdeMacBook-Pro:~ wlj$ ssh-keygen -R 47.**.***.*** # Host 47.**.***.*** found: line 1 /Users/wlj/.ssh/known_hosts updated. Original contents retained as /Users/wlj/.ssh/known_hosts.old wljdeMacBook-Pro:~ wlj$ ssh root@47.**.***.*** The authenticity of host '47.**.***.*** (47.**.***.***)' can't be established. ECDSA key fingerprint is SHA256:n9HdR0qHesf7Nx+D729TW47QZ9rdz8uDAwNlJQnMzeU. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '47.**.***.***' (ECDSA) to the list of known hosts.
