SSH遠程主機秘鑰失效的解決方法


一、問題描述:

遠程主機的SSH秘鑰發生了變化,在使用SSH遠程登錄的時候,提示如下

[root@localhost ~]# ssh root@172.16.48.10
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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:HDjXJvu0VYXWF+SKMZjSGn4FQmg/+w6eV9ljJvIXpx0.
Please contact your system administrator.
Add correct host key in /Users/wangdong/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /Users/wangdong/.ssh/known_hosts:46
ECDSA host key for 172.16.48.10 has changed and you have requested strict checking. Host key verification failed.

提示中紅色部分是問題關鍵,意思就是秘鑰發生了變化,但是你的本機保存的是原來的秘鑰

二、解決問題

  ssh-keygen -R IP(遠程的IP地址)

[root@localhost ~]# ssh-keygen -R 172.16.48.10
/root/.ssh/known_hosts updated.
Original contents retained as /root/.ssh/known_hosts.old

出現紅色部分提示表示成功,然后重新使用SSH遠程登錄即可

 

[root@localhost ~]# ssh admin@172.16.48.10

welcome

admin@172.16.48.10's password: 

******************************************************************************
* Copyright (c) 2004-2015 Hangzhou H3C Tech. Co., Ltd. All rights reserved.  *
* Without the owner's prior written consent,                                 *
* no decompiling or reverse-engineering shall be allowed.                    *
******************************************************************************

<testS5820V2-10>

 

 

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM