1

我的软件在 SUSE Enterprise Linux 11 SP2 上运行良好,但我必须升级到 SP3。升级我的基于 Net::SSH2 的 Perl 模块后,它只是挂起,没有给出任何错误,甚至没有超时。所以,我用 Net::SSH2 创建了一个简单的测试脚本,它在 SP2 机器上成功运行,但在 SP3 中没有。这是测试脚本

#!/usr/bin/perl
use strict;
use warnings;

use Net::SSH2;

my ($host, $user, $password) = ("myhost", "myuser", "mypassword");

print "Before Net::SSH2-new()\n";
my $ssh = Net::SSH2->new();

print "Before ssh->Connect\n";
$ssh->connect($host);

print "Before ssh->auth_keyboard\n";
$ssh->auth_keyboard($user, $password);

print "Before ssh->Channel\n";
my $channel = $ssh->channel();

print "Before Channel->blocking(0)\n";    
$channel->blocking(0);

print "Before Channel->exec\n";    
my $rt = $channel->exec("hostname");
print "The return value is: $rt \n";

#Closing connection
$channel->close;
$ssh->disconnect;

在 SP3 服务器中,我得到如下输出

myuser@myhost:~> perl  test_ssh  
Before Net::SSH2-new()

然后什么都没有。但在 SP2 服务器中,它可以正常工作。有人能说出导致这个问题的原因吗?

4

0 回答 0