ssh remote host identification has changed

前端 未结 29 2094
故里飘歌
故里飘歌 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:04

    Simple one-liner solution, tested on mac:

    sed '/212.156.48.110/d' ~/.ssh/known_hosts > ~/.ssh/known_hosts
    

    Deletes only the target ssh host IP from know hosts.

    where 212.156.48.110 is replaced by the target host IP address.

    Cause: Happened because the target IP was already known for a different machine due to port forwarding. Deleting the target IP before connecting will fix the issue.

提交回复
热议问题