ssh-copy-id 秘钥分发报错

重装了操作系统,本机/root/.ssh/known_hosts文件存在着上一次分发记录,所以导致以下报错

[root@node1 ~]# ssh-copy-id root@192.168.1.107
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed

/usr/bin/ssh-copy-id: ERROR: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
ERROR: @    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
ERROR: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
ERROR: IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
ERROR: Someone could be eavesdropping on you right now (man-in-the-middle attack)!
ERROR: It is also possible that a host key has just been changed.
ERROR: The fingerprint for the ECDSA key sent by the remote host is
ERROR: SHA256:VK3OAQJiLsUM+G2RAb0iJ9HiCFAVw1UOc+5DDshb57w.
ERROR: Please contact your system administrator.
ERROR: Add correct host key in /root/.ssh/known_hosts to get rid of this message.
ERROR: Offending ECDSA key in /root/.ssh/known_hosts:17
ERROR: ECDSA host key for 192.168.1.107 has changed and you have requested strict checking.
ERROR: Host key verification failed.

解决办法

[root@node1 ~]# ssh-keygen -R 192.168.1.107    

再次秘钥分发即可免密登录

[root@node1 ~]# ssh-copy-id root@192.168.1.107    
posted @ 2021-05-24 00:03  taotaozh  阅读(1288)  评论(0编辑  收藏  举报