2017-08-17 1 views
0

私はPerlのSSHパッケージを使って自分のRHELシステムに接続しています。私は最近、自分のVMの1つをredhat-release-server-7.2-9.el7.x86_64にアップグレードしました。今 私はそれがエラーを投げている私のPerlスクリプトを実行しています:/usr/local/lib64/perl5/Net/SSH/Perl/Kex.pm行の "Net :: SSH :: Perl :: Kex :: C25519"パッケージでオブジェクトメソッド "exchange"を見つけることができません107

Can't locate object method "exchange" via package "Net::SSH::Perl::Kex::C25519" at /usr/local/lib64/perl5/Net/SSH/Perl/Kex.pm line 107. when making the ssh object.

同じスクリプトがそうでなければ、私の6.8 RHELのバージョンに取り組んでいます。 提案がありますか?ここで

はコードです:

#!/usr/local/bin/perl 
use strict; 
use warnings; 
use Net::SSH::Perl; 
my $ssh = Net::SSH::Perl->new($server_ip, debug=>1); 
$ssh->login("root","password"); 

デバッグプリント:

[[email protected]_linux_10]# perl temp.pl 
Automation_linux_[Auto_server_ip]: Reading configuration data /root/.ssh/config 
Automation_linux_[Auto_server_ip]: Reading configuration data /etc/ssh_config 
Automation_linux_[Auto_server_ip]: Allocated local port 1023. 
Automation_linux_[Auto_server_ip]: Connecting to [SERVER_IP], port 22. 
Automation_linux_[Auto_server_ip]: Remote version string: SSH-2.0-OpenSSH_6.6.1 
Automation_linux_[Auto_server_ip]: Remote protocol version 2.0, remote software version OpenSSH_6.6.1 
Automation_linux_[Auto_server_ip]: Net::SSH::Perl Version 2.12, protocol version 2.0. 
Automation_linux_[Auto_server_ip]: No compat match: OpenSSH_6.6.1. 
Automation_linux_[Auto_server_ip]: Connection established. 
Automation_linux_[Auto_server_ip]: Sent key-exchange init (KEXINIT), waiting for response. 
Automation_linux_[Auto_server_ip]: Using [email protected] for key exchange 
Automation_linux_[Auto_server_ip]: Host key algorithm: ssh-ed25519 
Automation_linux_[Auto_server_ip]: Algorithms, c->s: [email protected] <implicit> none 
Automation_linux_[Auto_server_ip]: Algorithms, s->c: [email protected] <implicit> none 
Can't locate object method "exchange" via package "Net::SSH::Perl::Kex::C25519" at /usr/local/lib64/perl5/Net/SSH/Perl/Kex.pm line 107. 
+0

私たちはいくつかのコードを見る必要があります。また、2つのシステムにインストールされているモジュールのバージョンを確認すると便利です。 –

+0

Daveにお返事ありがとうございます。コードとデバッグプリントの両方を追加しました。 –

+0

https://stackoverflow.com/questions/5031334/perls-netssh-vs-ssh2-vs-openssh-how-should-i-compare-themに切り替えてください。 –

答えて

0

は私の推測では、あなたがCrypt::Curve25519perl moduleがインストールされていないということです。私はこれを発見するためにやった

は、このようなNet::SSH::Perl packageからKex.pmを修正しました:

--- lib/perl5/vendor_perl/5.26.0/i386-netbsd-thread-multi/Net/SSH/Perl/Kex.pm.orig  2017-08-23 11:10:46.000000000 +0000 
+++ lib/perl5/vendor_perl/5.26.0/i386-netbsd-thread-multi/Net/SSH/Perl/Kex.pm 
@@ -234,6 +234,9 @@ sub choose_kex { 
    if (my $pkg = $kexmap{$name}) { 
     $kex->{ssh}->debug("Using $name for key exchange"); 
     eval "use Net::SSH::Perl::Kex::$pkg"; 
+  if ([email protected]) { 
+   $kex->{ssh}->debug("Problem using Net::SSH::Perl::Kex::$pkg: [email protected]"); 
+  } 
     $kex->{class_name} = __PACKAGE__ . '::' . $pkg; 
    } else { 
     croak "Bad kex algorithm $name"; 

と、上記のPerlモジュールではなかったという膨大なエラーメッセージを取得するために、上記の小さなテストスクリプトを使用しました見つかりました。

+0

モジュールがあります。それ以外の場合、スクリプトはどのクライアントでも機能しませんが、6.8 RHELバージョンで動作します。 –

関連する問題