首页 Linux 使用scp提示错误ECDSA host key for [ip address] has changed and you

使用scp提示错误ECDSA host key for [ip address] has changed and you

使用scp提示错误ECDSA host key for [ip address] has changed and you have requested strict checking.

使用scp把本地服务器上的文件推送到阿里云服务器时遇到错误:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@WARNING:REMOTEHOSTIDENTIFICATIONHASCHANGED!@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
ITISPOSSIBLETHATSOMEONEISDOINGSOMETHINGNASTY!
Someonecouldbeeavesdroppingonyourightnow(man-in-the-middleattack)!
Itisalsopossiblethatahostkeyhasjustbeenchanged.
ThefingerprintfortheECDSAkeysentbytheremotehostis
SHA256:b226rUj4dIMPdvutGRAVuPd3ZwQiCS13ab3RPl+pKO8.
Pleasecontactyoursystemadministrator.
Addcorrecthostkeyin/root/.ssh/known_hoststogetridofthismessage.
OffendingECDSAkeyin/root/.ssh/known_hosts:1
removewith:
ssh-keygen-f"/root/.ssh/known_hosts"-R39.116.118.163
ECDSAhostkeyfor39.116.118.163haschangedandyouhaverequestedstrictchecking.
Hostkeyverificationfailed.
lostconnection

原因:需要重新获取新的秘钥,这是由于,ssh连接服务器时,如果之前连接过,ssh会默认保存该ip的连接协议信息,当我们再次访问此ip服务器时,ssh会自动匹配之前ssh保存的信息,由于我们的服务器做了更改,例如重装系统等操作,会导致本地保存的ssh信息失效,于是再次连接时就会出现上述错误。

另外,远程服务器的ssh服务被卸载重装或ssh相关数据(协议信息)被删除也会导致这个错误。

解决方法:直接在终端上上输入命令: ssh-keygen -R ip地址

注意R是大写,不是小写,目的是清除你当前机器里关于你的远程服务器的缓存和公钥信息。

root@user-70DGA014CN:/var/lib/redis_7021#ssh-keygen-R39.116.118.163
#Host39.106.118.63found:line1
/root/.ssh/known_hostsupdated.
Originalcontentsretainedas/root/.ssh/known_hosts.old
root@user-70DGA014CN:/var/lib/redis_7021#scp-r7021dump_20191217.rdbroot@39.116.118.163:/home/chenxinming/rdb/
Theauthenticityofhost'39.116.118.163(39.116.118.163)'can'tbeestablished.
ECDSAkeyfingerprintisSHA256:b226r123123Uj42dIMPd432vutGRAVuuPd3ZwQiCcS13ab3RPl+pKO8.
Areyousureyouwanttocontinueconnecting(yes/no)?

本文来自网络,不代表青岛站长网立场。转载请注明出处: https://www.0532zz.com/html/zhonghe/fwq/linux/20200805/8339.html
上一篇
下一篇

作者: dawei

【声明】:青岛站长网内容转载自互联网,其相关言论仅代表作者个人观点绝非权威,不代表本站立场。如您发现内容存在版权问题,请提交相关链接至邮箱:bqsm@foxmail.com,我们将及时予以处理。

为您推荐

返回顶部