centOS使用scp拷贝出错.

本文记录了一次使用SCP命令传输文件时遇到的远程主机密钥更改警告,并详细解释了解决这一问题的具体步骤,包括如何验证主机密钥及后续的安全处理措施。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

首先我ssh gaoyuedong@10.4.8.51 进入后, scp xxx.zip shirx@10.4.8.60:/home/shirx
但出现如下错误:
  [gaoyuedong@localhost Desktop]$ scp JniSamples.zip shirx@10.4.8.60:/usr/local
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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 the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
a8:ff:7b:83:e1:8b:fb:25:cd:8b:00:6c:9c:d9:db:bd.
Please contact your system administrator.
Add correct host key in /home/gaoyuedong/.ssh/known_hosts to get rid of this message.
Offending key in /home/gaoyuedong/.ssh/known_hosts:2
RSA host key for 10.4.8.60 has changed and you have requested strict checking.
Host key verification failed.
lost connection
解决办法:
  ssh gaoyuedong@10.4.8.51后,删除 /home/gaoyuedong/.ssh/knowhost我的机器那一行,
原因是我安装机器之前曾经scp过,生成了一个密要保存在他机器此文件中,我重新安装
机器后需要密要就改编了.所以需要删除我的~/,ssh/knowhost中辑录,一击他的~/.ssh/knowhost
中辑录.就好了.     
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值