Net :: OpenSSH无法连接“ctr_dir不安全”错误

时间:2017-04-22 20:48:43

标签: perl

我有一个曾经突然停止工作的脚本。我将问题追溯到连接到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/meme所有。该脚本由me拥有并执行。在.libnet-openssh-perl上将perms更改为500或600无济于事。

我删除了〜/ .libnet-openssh-perl并让脚本为我创建一个新的。它确实将perms设置为700.但是脚本仍然不起作用。我已经尝试了其他所有烫发组合,但它仍然不起作用。

该脚本在几个月前停止工作,所以我不知道哪些服务器配置可能已经改变,可能会破坏它。

1 个答案:

答案 0 :(得分:1)

将/ home / me目录设置为755解决了问题。