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

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

     ssh 远程连接是没有问题的,但是当使用scp username@x.x.x.x:/时,发现不能用,报错:
command-line: line 0: Bad configuration option: PermitLocalCommand

网上查找资料,发现主要类型如下:
[root@server ssh]# lsattr /usr/bin/ssh
-u--ia------- /usr/bin/ssh
[root@server ssh]# lsattr /usr/sbin/sshd
-u--ia------- /usr/sbin/sshd

[root@server ssh]# chattr -uia /usr/bin/ssh
[root@server ssh]# chattr -uia /usr/sbin/sshd

[root@server ssh]# lsattr /usr/bin/ssh
------------- /usr/bin/ssh
[root@server ssh]# lsattr /usr/sbin/sshd
------------- /usr/sbin/sshd
可是我的问题不是这样的,后来发现一篇文章,和我的情况差不多,这样的解释也没能帮助他解决,
作者是这样回答的:

Anyway, after some time spent in Google, the problem seemed to be that our /usr/bin/ssh was incompatible with the sftp and scp commands.

Each time a command like ‘sftp’ is called, it automatically adds a hidden parameter ‘PermitLocalCommand=no’ and then calls ssh (usually /usr/bin/ssh). In our case, our /usr/bin/ssh command had no idea what ‘PermitLocalCommand’ meant and simply rejected it.

If you are having the same problem, try something like this directly to your ssh command:

ssh username@aserver.com -o PermitLocalCommand=no      尝试后,果然是报同样的错误。

If ssh returns an error, then you probably have the same issue as we had.    这句话看着太有同感了,我的问题就这样。

作者是这样解决的:

The fix

In our case, the fix was really simple. We just removed and re-installed the open-ssh client code as follows:

sudo apt-get remove openssh-client        
sudo apt-get install openssh-client

Then, all returned to normal.          ------看来他是重装了。


因为不能scp等传送文件,只能用VNC,然后配置DNS下载了(当然从百度找了大半天,发现内容都一样,还是google上东西比较全些)
网址:http://rpm.pbone.net (rpm包还是很全的),直接搜索就可以了。
我的系统是 redhat 5.8 64位的;rpm包如下:
openssh-4.3p2-82.el5.x86_64.rpm
openssh-askpass-4.3p2-82.el5.x86_64.rpm
openssh-clients-4.3p2-82.el5.x86_64.rpm
openssh-server-4.3p2-82.el5.x86_64.rpm
安装完成后,问题得以解决!
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值