ssh remote host identification has changed

前端 未结 29 1949
故里飘歌
故里飘歌 2020-12-02 03:02

I\'ve reinstalled my server and I am getting these messages:

[user@hostname ~]$ ssh root@pong
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@           


        
相关标签:
29条回答
  • 2020-12-02 04:06

    The sledgehammer is to remove every known host in one fell swoop:

    rm ~/.ssh/known_hosts
    

    I come up against this as we use small subnets of short-lived servers from a jump box, and frequently have internal IP address reuse of servers that share the same ssh key.

    0 讨论(0)
  • 2020-12-02 04:06

    Simply clear the known_hosts which is present in /home/{username}/.ssh/known_hosts

    vi /home/{username}/.ssh/known_hosts 
    

    remove every line inside known hosts and exit after that you will be able to login.

    OR

    run this command

    ssh-keygen -R "hostname/ip_address" 
    
    0 讨论(0)
  • 2020-12-02 04:07

    Here is the simplest solution

    ssh-keygen -R <host>
    

    For example,

    ssh-keygen -R 192.168.3.10
    

    From ssh-keygen man page:

    • -R hostname Removes all keys belonging to hostname from a known_hosts file. This option is useful to delete hashed hosts (see the -H option above).
    0 讨论(0)
  • 2020-12-02 04:08

    I used the solution of mockinterface, though the sed -i didn't quite work I solved it by deleting the line by hand with vim:

    sudo vim /var/lib/sss/pubconf/known_hosts
    

    You can use any other text editor you want, but probably you'll need to show your administrative privileges

    0 讨论(0)
  • 2020-12-02 04:08

    Use this command:

    truncate -s 0 /home/SYSTEM_NAME/.ssh/known_hosts
    
    0 讨论(0)
提交回复
热议问题