服务器执行交换密钥
之前配置过一次免密,服务器重置或者配置失误导致历史残留影响了重新配置

cd /root/.ssh 将文件里的内容清空
在这里插入图片描述

执行ssh命令
ssh-keygen -t rsa
覆盖/root/.ssh/id_rsa时输入y确定,其他时候都直接确定
或者在之前就删除这个文件
在这里插入图片描述

连接其他主机 输入主机名或ip
ssh-copy-id hostname/ip

/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:qA1jELisVKN+7uowL+npiqXX8Iz1pacDd11l+kN6RoY.
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:1
ERROR: ECDSA host key for xxx.xx.xx.xx has changed and you have requested strict checking.
ERROR: Host key verification failed.
Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐