• 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/

  • 相关阅读:
    django 项目 crm 关于展示表的细节
    djagngo crm 项目 展示页面 和分页
    django项目 crm登录 注册
    django项目 crm表结构一些常用的字段
    django认证 auth
    django form组件
    json和ajax技术
    VS 2013编译64位版本QT 4.8.6及使用cmake为依赖QT生成VS项目时Could NOT find Qt4
    使用国内pypi源来安装python包
    [转]ubuntu 下无法启动chrome
  • 原文地址:https://www.cnblogs.com/tlmn2008/p/5306632.html
Copyright © 2020-2023  润新知