ssh remote host identification has changed

前端 未结 29 1948
故里飘歌
故里飘歌 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 03:46

    For Mac users, you can use the -R flag of the ssh-keygen command. Quick example:

    ssh-keygen -R THE_IP_ADDRESS
    

    THE_IP_ADDRESS being the IP you're trying to ssh into. And then you can connect fine.

    0 讨论(0)
  • 2020-12-02 03:48

    Works for me!

    Error: Offending RSA key in /var/lib/sss/pubconf/known_hosts:4

    This indicates you have an offending RSA key at line no. 4

    Solution 1:

    1. vi /var/lib/sss/pubconf/known_hosts

    2. remove line no: 4.

    3. Save and Exit, and Retry.

    Solution 2:

    ssh-keygen -R "you server hostname or ip"

    OR

    Solution 3:

    sed -i '4d' /root/.ssh/known_hosts

    This will remove 4th line of /root/.ssh/known_hosts in place(-i).

    0 讨论(0)
  • 2020-12-02 03:48

    In my case it happened because I previously had ssh connection with a machine with same ip(say 192.152.51.10) and the system was considering the RSA key(stored in /home/user_name/.ssh/known_hosts) of the previous host which resulted in mismatch.

    To resolve this issue, you have to remove previously stored RSA key for the ip 192.152.51.10.

    ssh-keygen -f "/home/user_name/.ssh/known_hosts" -R 192.152.51.10
    
    0 讨论(0)
  • 2020-12-02 03:48

    SOLUTION:

    1- delete from "$HOME/.ssh/known_hosts" the line referring to the host towards which is impossible to connect.

    2- execute this command: ssh-keygen -R "IP_ADDRESSorHOSTNAME" (substitute "IP_ADDRESSorHOSTNAME" with your destination ip or destination hostname)

    3- Retry ssh connection (if it fails please check permission on .ssh directory, it has to be 700)

    0 讨论(0)
  • 2020-12-02 03:50

    Edit /home/hostname /.ssh/known_hosts,and delete the 4 lines, and save it.

    Then run ssh root@pong again, you will see message like this:Are you sure you want to continue connecting (yes/no)? yes, just print yes.

    Note: If you got some problem, read the hints first, it will help.

    0 讨论(0)
  • 2020-12-02 03:50

    I had this problem, and the reason is very simple, I have a duplicated IP address to ssh login, so after modify this problem, everthing is solved.

    0 讨论(0)
提交回复
热议问题