【发布时间】:2014-08-18 04:40:30
【问题描述】:
我正在尝试使用 Net::OpenSSH::Gateway 创建持久网关连接。下面是我使用的代码 sn-p。
my %proxy_opts = (
host => $host,
port=>$port,
password=>$password,
user=>$user ,
scheme=>"ssh",
ssh_cmd => '/usr/bin/ssh',
master_opts =>
[ -o=>"StrictHostKeyChecking=no",
-o=>"TCPKeepAlive=no",
-o=>"ServerAliveInterval=30",
-o=>"ServerAliveCountMax=90",
-o=>"ControlPath=/tmp/ssh-master-%h_%p_%r",
-o=>"ControlPersist=yes"
]
);
my %gateway_settings = ( proxies=>[ {%proxy_opts} ]);
my $gateway = Net::OpenSSH::Gateway->find_gateway(%gateway_settings, errors=>$errors);
我收到以下错误。但是,如果我删除了 ControlPath 和 ControlPersist 选项,整个事情就可以正常工作了。
[错误] 无法建立主 SSH 连接:坏 ssh master at /root/.libnet-openssh-perl/spangeni-j1.zscaler.-31930-744378,套接字 由 pid 31933 拥有(应为 pid 31931)
【问题讨论】:
-
看here也许这有帮助。
-
我在发布之前看到了。我的 ssh 二进制文件没有包装器。我也提供了 ssh_cmd 选项。