当前位置:   article > 正文

配置免密登陆_虚拟机ssh-copy-id命令报错no route to host

虚拟机ssh-copy-id命令报错no route to host

 

     当通过 ssh-copy-id -i ~/.ssh/id_rsa.pub root@IP,命令配置免密登陆的时候出现如下问题:

  1. /usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
  2. /usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
  3. /usr/bin/ssh-copy-id: ERROR: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  4. ERROR: @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
  5. ERROR: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  6. ERROR: IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
  7. ERROR: Someone could be eavesdropping on you right now (man-in-the-middle attack)!
  8. ERROR: It is also possible that a host key has just been changed.
  9. ERROR: The fingerprint for the ECDSA key sent by the remote host is
  10. ERROR: SHA256:6S5JqT1YG+i1Mv9OpkDewUZ+ApQkJQQ7j6bT3ajAxjo.
  11. ERROR: Please contact your system administrator.
  12. ERROR: Add correct host key in /root/.ssh/known_hosts to get rid of this message.
  13. ERROR: Offending ECDSA key in /root/.ssh/known_hosts:4
  14. ERROR: ECDSA host key for IP地址 has changed and you have requested strict checking.
  15. ERROR: Host key verification failed.

  这是因为,需要登陆的主机已经存在于 known_hosts 文件中,但是 key 的信息改变了,所以我们只要删除  known_hosts 文件中该主机的 key 信息,然后重新执行一遍 ssh-copy-id -i ~/.ssh/id_rsa.pub root@IP 就好了。

1)根据 行头部的ip 或则和hostname 信息,删除 known_hosts 中的信息:

2)重新执行  ssh-copy-id -i ~/.ssh/id_rsa.pub root@IP

3)大功告成 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家小花儿/article/detail/187754?site
推荐阅读
相关标签
  

闽ICP备14008679号