zoukankan      html  css  js  c++  java
  • ssh-copy-id 遇到ERROR: Host key verification failed.

    由于在/home/user/.ssh/known_hosts中记录的目标机器信息与当前不符(多为重用了IP地址造成),执行Ssh-copy-id时有下面的报错:

    [bmsc_ci@jenkins-slave2 ~]$ ssh-copy-id -i /home/user/.ssh/id_rsa.pub root@192.168.125.112
    /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 RSA key sent by the remote host is
    ERROR: 39:b0:5f:e1:01:77:fe:5b:b9:ff:2d:2b:a0:fd:f5:3a.
    ERROR: Please contact your system administrator.
    ERROR: Add correct host key in /home/user/.ssh/known_hosts to get rid of this message.
    ERROR: Offending RSA key in /home/user/.ssh/known_hosts:185
    ERROR: RSA host key for 192.168.125.112 has changed and you have requested strict checking.
    ERROR: Host key verification failed.

    解决方法:

    ssh-copy-id  -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null  -i /home/user/.ssh/id_rsa.pub root@192.168.125.112

    同样地,此情况时ssh, scp 也会报错,解决办法是:

    ssh -q -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@192.168.125.112

    scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -r /var/tmp/performance/moo.dat root@192.168.125.110:/var/tmp/

  • 相关阅读:
    创建struct类型的数组
    simulate windows touch input
    Could not load file using Ranorex runtime : General Questions
    UIAutomator 编译
    w3cmark前端精彩博文周报 10.27-11.2
    w3cmark前端精彩博文周报 10.20-10.27
    w3cmark前端精彩博文周报 10.13-10.19
    sublime自定义snippet代码片段
    Iconfont在移动端遇到问题的探讨
    一个小效果引出的兼容性探讨
  • 原文地址:https://www.cnblogs.com/tlmn2008/p/5306632.html
Copyright © 2011-2022 走看看