command-line: line 0: Bad configuration option: PermitLocalCommand

简介:

废话少说,问题描述与解决

今天在一server上传输文件时,遇到scp error

[root@server01 ~]# scp aa.txt  root@192.168.0.1:/home/software/

command-line: line 0: Bad configuration option: PermitLocalCommand

lost connection

刚发现此问题时,还以为是sshd服务问题,将sshd重启后,问题依旧,查了些资料,说是sshd的配置文件问题,从其它server上拷贝文件,重启sshd服务,问题依旧,纠结。。。

之后将openssh的clients包重安装下,报如下错误:

[root@server228 software]# rpm -ivh openssh-clients-4.3p2-29.el5.x86_64.rpm 

Preparing...                ########################################### [100%]

   1:openssh-clients        ########################################### [100%]

error: unpacking of archive failed on file /usr/bin/ssh: cpio: rename failed - 不允许的操作

由此可见是/usr/bin/ssh出现异常

此时,查看/usr/bin/ssh的详细信息,当看到权限和属性时,发现

[root@server01 bin]# lsattr ssh

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

 

此时看到这个属性,心中就有疑问了,于是找了其他server上的ssh程序权限和属性看了一下,。 

[root@server46 ~]# lsattr /usr/bin/ssh

------------- /usr/bin/ssh 

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

chattr -uia /usr/bin/ssh

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

 

 

       本文转自天真花语  51CTO博客,原文链接:http://blog.51cto.com/caibird/737164,如需转载请自行联系原作者


相关文章
Error running Application. Command line is too long.
【2月更文挑战第2天】Error running Application. Command line is too long. 问题处理
|
Java
IDEA-解决Command line is too long. Shorten command line for SpringBootMainApplication or also for App
IDEA-解决Command line is too long. Shorten command line for SpringBootMainApplication or also for App
83 0
|
Java
【异常】SpringBoot报错Command line is too long.Shorten command line for Application or also for Applicatio
【异常】SpringBoot报错Command line is too long.Shorten command line for Application or also for Applicatio
509 0
|
Java
解决Command line is too long. Shorten command line for ServiceStarter or also for Application报错
解决Command line is too long. Shorten command line for ServiceStarter or also for Application报错
366 0
成功解决absl.flags._exceptions.UnrecognizedFlagError: Unknown command line flag 'data_format'
成功解决absl.flags._exceptions.UnrecognizedFlagError: Unknown command line flag 'data_format'
运行 ‘ApiApplication‘ 出错: Command line is too long. Shorten command line for ShopApiApplication or
运行 ‘ApiApplication‘ 出错: Command line is too long. Shorten command line for ShopApiApplication or
231 0
运行 ‘ApiApplication‘ 出错: Command line is too long. Shorten command line for ShopApiApplication or
Error running 'XXXApplication': Command line is too long. Shorten command line forXXX
Error running 'XXXApplication': Command line is too long. Shorten command line forXXX
158 0
Error running 'XXXApplication': Command line is too long. Shorten command line forXXX
Command line is too long. Shorten command line for AppWebStarter or...(已解决)
找到你项目中 .idea/workspace.xml文件 找到 < component name=“PropertiesComponent” > 在标签内部加上这句
166 0
Command line is too long. Shorten command line for AppWebStarter or...(已解决)