zoukankan      html  css  js  c++  java
  • 解决Host key verification failed.(亲测有效)

    哈喽哇,今天在访问远程服务器的时候,出现了一个小问题。

    原因:之前ssh联系过服务器,重置服务器后,再次连接服务器,就会出这个问题。

    一、发现问题

    问题如下图代码:

    $ ssh root@108.61.163.242
    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    @    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 ECDSA key sent by the remote host is
    SHA256:HDjXJvu0VYXWF+SKMZjSGn4FQmg/+w6eV9ljJvIXpx0.
    Please contact your system administrator.
    Add correct host key in /Users/wangdong/.ssh/known_hosts to get rid of this message.
    Offending ECDSA key in /Users/wangdong/.ssh/known_hosts:46
    ECDSA host key for 108.61.163.242 has changed and you have requested strict checking.
    Host key verification failed.
    

    这里面,有一句很关键。

    ECDSA host key for 108.61.163.242 has changed and you have requested strict checking.
    Host key verification failed.
    

    一般这个问题,是你重置过你的服务器后。你再次想访问会出现这个问题。

    二、解决问题

    解决问题也很简单:

    ssh-keygen -R 你要访问的IP地址

    例如:

    ssh-keygen -R 108.61.163.242

    贴个图更直观

  • 相关阅读:
    session判断重复提交
    logback日志配置
    quartz动态job工具类 serviceh注入问题
    mysql10061登录失败错误解决方案
    安装步骤
    无法启动此程序,因为计算机丢失MSVCP120.dll
    Bigdecimal: Non-terminating decimal expansion; no exact representable decimal result.
    replace()函数用法
    随机读取表中一条数据
    oracle table()函数
  • 原文地址:https://www.cnblogs.com/haima/p/14105776.html
Copyright © 2011-2022 走看看