@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@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 RSA key sent by the remote host isSHA256:這裏每個人都不同Please contact your system administrator.Add correct host key in /Users/Anan/.ssh/known_hosts to get rid of this message.Offending RSA key in /Users/Anan/.ssh/known_hosts:1RSA host key for 這裏是服務器的IP has changed and you have requested strict checking.Host key verification failed.
會出現這些信息是因爲,第一次SSH連接時,會生成一個認證,儲存在客戶端(也就是用SSH連線其他電腦的那個,自己操作的那個)中的known_hosts,但是如果服務器驗證過了,認證資訊當然也會更改,服務器端與客戶端不同時,就會跳出錯誤啦~因此,只要把電腦中的認證資訊刪除,連線時重新生成,就一切完美啦~要刪除很簡單,只要在客戶端輸入一個指令
ssh-keygen -R +輸入服務器的IP
接下來再次連接一次,會出現
Are you sure you want to continue connecting (yes/no)?
輸入yes,
就完成連接啦!同時,新的認證也生成了
在mac下使用終端連接服務器方式
ssh root@服務器地址