Net :: SSH2 :: Simple在更新到Windows10后失败

问题描述 投票:2回答:1

那里

在网上::: SSH2 ::简单,将Windows7更新到Windows10后,不再通过ssh连接它。有以下错误。

Net::SSH2::net_ss_timeout: invalid object Net::SSH2::Simple=SCALAR(0x3f5c218) at C:/Strawberry/perl/vendor/lib/Net/SSH2.pm line 111.
 at C:/Strawberry/perl/vendor/lib/Net/SSH2.pm line 111.
    Net::SSH2::connect(Net::SSH2::Simple=SCALAR(0x3f5c218), "xxxx.com", 22) called at C:/tool/eclipse_classic/workspace/test/work14.pl line 98
    (in cleanup) Net::SSH2::net_ss_DESTROY: invalid object Net::SSH2::Simple=SCALAR(0x3f5c218) at C:/tool/eclipse_oxygen/eclipse/workspace/.metadata/.plugins/org.epic.debug/perl5db.pl line 4211.

我的代码是

use Net::SSH2::Simple;

    $ssh2 = Net::SSH2::Simple->new();
    $ssh2->connect( 'xxxx.com', 22 ) ;
    $ssh2->auth_password( 'username', 'passwd' );

错误出现在“ $ ssh2->连接”行。

但是通过使用Net :: SSH2,此代码可以正常工作。仅Net :: SSH2 :: Simple不起作用。

到xxxx.com的连接很好。且未找到用户名,密码错误。

我该如何解决。

Windows10 64位草莓Perl 5.30.1.1(64位)蚀氧史诗0.77

谢谢

perl perl-module strawberry-perl
1个回答
3
投票

Net :: SSH2 :: Simple 0.01已于2009年12月13日发布。当时Net :: SSH2为0.28(2009-10-24),现在为0.70(2019-3-17)。

我安装了Net :: SSH2的早期版本0.58(2015-12-20),使用Net :: SSH2 :: Simple可以在Windows10 64bit / Strawberry Perl 5.30.0.1(64bit)上运行

cpan install SALVA/Net-SSH2-0.58.tar.gz

版本0.59_20(2016-05-11)给出了'net_ss_timeout:无效对象'错误。版本0.59_01的change log出现此警告]

      ** WARNING: this release includes lots of changes, some
      visible, most internal. Regressions are expected. Also,
      it introduces some minor backward incompatible changes -
      but in those cases, the old behavior was broken or insane
      anyway.
© www.soinside.com 2019 - 2024. All rights reserved.