How to establish ssh key pair when “Host key verification failed”

后端 未结 11 1923
抹茶落季
抹茶落季 2021-01-30 10:17

I have set up ssh key pairs between my desktop and two servers, and from the servers to my desktop, but after reinstalling the OS on my desktop, I can\'t re-establish the key-pa

11条回答
  •  时光取名叫无心
    2021-01-30 10:58

    Its means your remote host key was changed (May be host password change),

    Your terminal suggested to execute this command as root user

    $ ssh-keygen -f "/root/.ssh/known_hosts" -R [www.website.net]:4231
    

    You have to remove that host name from hosts list on your pc/server. Copy that suggested command and execute as a root user.

    $ sudo su                                                            // Login as a root user
    
    $ ssh-keygen -f "/root/.ssh/known_hosts" -R [www.website.net]:4231   // Terminal suggested command execute here
    Host [www.website.net]:4231 found: line 16 type ECDSA
    /root/.ssh/known_hosts updated.
    Original contents retained as /root/.ssh/known_hosts.old
    
    $ exit                                                               // Exist from root user
    
    $ sudo ssh root@www.website.net -p 4231                              // Try again
    

    I Hope this works.

提交回复
热议问题