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重新输入密码即可

Logo

技术共进,成长同行——讯飞AI开发者社区

更多推荐