加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

LINUX无法SCP故障

(2017-08-09 09:36:17)
标签:

it

分类: LINUX
一.无法SCP报告

[root@zj2 webapps]# scp -r  monitor root@210.21.118.214:/tmp
command-line: line 0: Bad configuration option: PermitLocalCommand
lost connection


二.查SCP操作的本机SSH 属性

[root@server01 bin]# lsattr ssh

-u--ia------- ssh

 

对比其他server上的ssh程序权限和属性看了一下:

root@sc211 .ssh]# lsattr /usr/bin/ssh
------------- /usr/bin/ssh


三.用chattr修改属性

于是将ZJ2上的ssh属性将uia去掉,命令:

chattr -uia /usr/bin/ssh

再重启sshd服务,问题即可解决!

service sshd restart




四.还有些SCP故障,是因原来SCP过,后对方HOSTNAME又更改了,可检查:
本机的$HOME/.ssh/authorized_keys,改正HOSTNAME










另外:
[root@web1 webapps]# scp -r ./billing root@192.168.87.80:/tmp/
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
   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
63:46:c6:04:c8:c5:ce:4c:34:52:21:55:61:0d:d4:78.
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:8
RSA host key for 192.168.87.80 has changed and you have requested strict checking.
Host key verification failed.
lost connection

[root@web1 webapps]#vi /root/.ssh/known_hosts
注释掉192.168.87.80行


另外,如
[root@sw2 hzlong]# scp ./  check_expried_all_and_asr.sh check_expried_log_all.sh check_expried_log.sh  clr_old_dmp.sh root@192.168.87.81:/home/hzlong/
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
   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
c2:25:e2:97:80:61:69:c2:8f:1b:b7:1d:bc:78:64:a4.
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:15
RSA host key for 192.168.87.81 has changed and you have requested strict checking.
Host key verification failed.
lost connection


 删除本机上下列192.168.87.81 行后正常
[root@sw2 hzlong]# vi /root/.ssh/known_hosts

192.168.87.81 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAyY/wU9Ck/N1QWNeZKXEgpZDo9YznqgCojmt69Mhc4lqyuOSHGRne47JyUezzY/SrPBPxdlo+dEwGP2sn9AbZZd5pD2NrunKCsDkmAs1FnVpZnGoq71soOLYpHnyRAnHNj6IbusSRyZV5rRy7PK1T+d5kzEo6IgDN5evqO4c1u9vUhMrYmE/STJWRjGk71kih7tZucMRJ84dFS9Cou4jUXp4iuk88VWalAKLQq3YsaWRym5Lsb6GlnD/wSwyrW8+kGOreKnb2kWQiHpdPTdCDDXN8i0JyqE6j76008L8OWAFNE8BlZBSaG32Qtls9blrHu3j8hT0J4VPKd7Ayh7gypQ==

0

阅读 收藏 喜欢 打印举报/Report
前一篇:ORACLE改字体
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有