windows scp报错:Host key verification failed.

当使用SCP在Windows系统上将文件复制到远程服务器时,遇到了主机密钥改变的警告,导致拷贝失败。解决方法是通过在CMD中运行`ssh-keygen -R 远程IP`命令删除旧的主机密钥记录,然后重新尝试SCP操作。执行该命令后,系统会更新已知主机文件,并提示可以重新连接。按照提示再次输入密码,即可成功拷贝文件。
摘要由CSDN通过智能技术生成

windows系统使用scp拷贝文件到服务器中报错:

E:\google>scp ./go1.18.4.linux-amd64.tar.gz root@152.32.209.98:/root
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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:YSM2gb6Yd6RFrqjMZXa+fDdvnGlKJooY4ZuBG0Ma7QI.
Please contact your system administrator.
Add correct host key in C:\\Users\\time/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in C:\\Users\\time/.ssh/known_hosts:7
ECDSA host key for 152.32.209.98 has changed and you have requested strict checking.
Host key verification failed.
lost connection

解决方案
在本机cmd执行:

ssh-keygen -R 远程ip

结果:

E:\google>ssh-keygen -R 152.32.209.98
# Host 152.32.209.98 found: line 6
# Host 152.32.209.98 found: line 7
C:\Users\time/.ssh/known_hosts updated.
Original contents retained as C:\Users\time/.ssh/known_hosts.old

再次使用scp重新输入密码即可

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值