文章内容
2022/4/19 14:45:22,作 者: 黄兵
Warning: the ECDSA host key for '[]:22' differs from the key for the IP address
最近在在使用 scp 服务文件的时候,出现了如下警告⚠:
Warning: the ECDSA host key for '[domain]:22' differs from the key for the IP address '[1.1.1.1]:22' Offending key for IP in /root/.ssh/known_hosts:1 Matching host key in /root/.ssh/known_hosts:5 Are you sure you want to continue connecting (yes/no)?
出现问题的原因:
是由于 host key 文件不匹配,所以出现了如上警告,只要我们输入 yes 就可以了,但是每一次执行 scp 都要输入 yes 非常麻烦。
解决方案:
我们直接编辑 /root/.ssh/known_hosts
的文件,删除第一行和第五行,之后保存文件,就可以解决问题了。
参考资料:
1、How to fix warning about ECDSA host key
黄兵个人博客原创。
转载请注明出处:黄兵个人博客 - Warning: the ECDSA host key for '[]:22' differs from the key for the IP address
评论列表