【Linux】scp IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY! 错误

本文详细解析了SCP传输过程中遇到的警告信息及主机密钥验证失败问题,提供了ssh-keygen命令的使用方法来更新信任的主机密钥,同时解决了因缺少scp包导致的传输失败,并探讨了SSH连接被拒的原因,包括SSH服务未安装和22号端口未开启的情况,给出了具体的解决步骤。

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

SCP 报如下错误:

[root@node1 home]# scp -r root@10.42.28.85:/home/yw_bak   ./
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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:MJQiGQwCxl0kK12rkvaoQHuzf9ef5Nek/FYEL7wheUg.
Please contact your system administrator.
Add correct host key in /root/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /root/.ssh/known_hosts:5
ECDSA host key for 10.42.28.85 has changed and you have requested strict checking.
Host key verification failed.

解决方法:

cd ~
cd .ssh

ssh-keygen -R xx.xx.xx.xx  

scp传输提示bash: scp: command not found

其中一端缺少scp相关的包

[oracle@rac1 dump_dir]$ scp /mnt/dump_dir/expdp_orders_2tabs2* 192.168.X.247:/home/oracle/dump_dir
oracle@192.168.X.247's password:
bash: scp: command not found
目标
[root@localhost ~]# -bash: scp: command not found
-bash: -bash:: command not found

[root@localhost ~]# yum install openssh-clients

 

CentOS出现连接被拒--ssh:connect to host centos-py port 22: Connection refused

问题原因:  

我在配置ssh免登录时候出现该问题,其错误原因主要有以下几种:

  1)SSH服务未安装

    此时,采用在线安装的方式就行下载安装。

命令为:          yum -y install openssh-server;

然后启动ssh服务:    service sshd start。

  2)ssh服务对应22号端口未开启

ss -lnt :使用该命令查询22号端口是否开启,如果为下图所示为正常开启,

 

否则要先开启22号端口。 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值