`
yuanke
  • 浏览: 69714 次
  • 性别: Icon_minigender_2
  • 来自: 临沂
社区版块
存档分类
最新评论

centos spc 出错

scp 
阅读更多

  重装系统后,从另一台机器中scp文件,出现了如下提示,重装前是可以scp的。

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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
62:7c:e9:74:26:2b:58:cb:7c:45:53:6a:65:be:9f:2e.
Please contact your system administrator.
Add correct host key in /root/.ssh/known_hosts to get rid of this message.
Offending key in /root/.ssh/known_hosts:1
RSA host key for 192.168.7.171 has changed and you have requested strict checking.
Host key verification failed.
lost connection
     百度了一下,立马解决,又一次真的感谢网络的便捷,网友的无私共享。

方法如下:

在运行scp的机器中,找到该用户家目录下的如下的ssh连接文件夹:
1. cd ~/.ssh/
2. vi known_hosts
3. 找到和远程主机ip一致的密钥保存信息,直接dd删除,然后:x保存退出
4. 重新连接,输入密码,发现连接成功

问题解决。原来是记录了重装前的密钥,所以出现错误。删除后重新获取就OK了。

scp的一般命令:

传送文件:  scp filename username@ip:dir,如scp a.txt root@192.168.7.2:/home/aa

传送文件夹:scp -r dir username@ip:dir, 如scp -r bb root@192.168.7.2:/home/aa

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics