scp Host key verification failed.

发布时间:2018-04-29作者:laosun阅读(2415)

scp

sun:~ sun$ scp xxx root@ip:/mnt @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!

    sun:~ sun$ scp /Users/sun/Documents/apache-tomcat-7.0.86.tar.gz root@ip哦:/mnt
    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    @    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
    Someone could be eavesdropping on you right now (man-in-the-middle attack)!
    It is also possible that a host key has just been changed.
    The fingerprint for the RSA key sent by the remote host is
    SHA256:u/m4HwxSpoS/EshBWK136Ek87rtCaOpk6iQKZ3TcxvM.
    Please contact your system administrator.
    Add correct host key in /Users/sun/.ssh/known_hosts to get rid of this message.
    Offending RSA key in /Users/sun/.ssh/known_hosts:5
    RSA host key for ip哦 has changed and you have requested strict checking.
    Host key verification failed.
    lost connection
    sun:~ sun$ cd /Users/sun/.ssh/
    sun:.ssh sun$ ll
    total 16
    -rw-r--r--  1 sun  staff   399  4 23  2016 authorized_keys
    -rw-r--r--  1 sun  staff  1925  4 25 10:12 known_hosts
    sun:.ssh sun$ rm -rf known_hosts


    大概是因为 ip哦 的主机密钥改了,而本机使用的还是原来的公钥与其匹配,因此会出现错误。有人问不是我们使用密码么,嗯,原因是这样,一旦使用本机ssh连接过目标机,则会在目录下生成目标机的公钥,以便下次可以直接使用。所以,我们可以把该文件下 ip哦 对应的公钥删除掉

1 +1

版权声明

 linux

 请文明留言

0 条评论