我有一个曾经突然停止工作的脚本。我将问题追溯到连接到Net::OpenSSH
的服务器的一行。我设置了一个简单的脚本来测试Net::OpenSSH
:
use Net::OpenSSH
my $ssh = Net::OpenSSH->new('myhost.com');
print $ssh->error;
抛出:ctl_dir /home/me/.libnet-openssh-perl/ is not secure
错误。
模块文档说明如下:
ctl_dir => $path
Directory where the SSH master control socket will be created.
This directory and its parents must be writable only by the current effective user or root, otherwise the connection will be aborted to avoid insecure operation.
By default ~/.libnet-openssh-perl is used.
目录上的权限是700.目录由我拥有。 /home
目录由root拥有。 /home/me
归me
所有。该脚本由me
拥有并执行。在.libnet-openssh-perl
上将perms更改为500或600无济于事。
我删除了〜/ .libnet-openssh-perl并让脚本为我创建一个新的。它确实将perms设置为700.但是脚本仍然不起作用。我已经尝试了其他所有烫发组合,但它仍然不起作用。
该脚本在几个月前停止工作,所以我不知道哪些服务器配置可能已经改变,可能会破坏它。
答案 0 :(得分:1)
将/ home / me目录设置为755解决了问题。