Search code examples
perlsshnet-sshperlnetsshpublic-key-exchange

Net::SSH::Perl throws error No kex algorithm at /usr/share/perl5/vendor_perl/Net/SSH/Perl/SSH2.pm line 92


I am using Net::SSH::Perl to connect to a Qlogic switch. when it fails with the below error:

No kex algorithm at /usr/share/perl5/vendor_perl/Net/SSH/Perl/SSH2.pm line 92

Code:

use Net::SSH::Perl;
$ssh = Net::SSH::Perl->new("$switch_name", protocol=>'2,1',debug=>1);
$ssh->login("USER","$pw");
($stdout,$stderr,$exit) = $ssh->cmd("$cmd");

Debug output:

myserver: Reading configuration data /export/home/ibmi1984/.ssh/config
myserver: Reading configuration data /etc/ssh_config
myserver: Connecting to HFDB12PF26A, port 22.
myserver: Remote protocol version 2.0, remote software version OpenSSH_6.7
myserver: Net::SSH::Perl Version 1.34, protocol version 2.0.
.yserver: No compat match: OpenSSH_6.7
myserver: Connection established.
myserver: Sent key-exchange init (KEXINIT), wait response.
No kex algorithm at /usr/share/perl5/vendor_perl/Net/SSH/Perl/SSH2.pm line 92

Could someone please help me fix this. The same code works on other devices, it is just this device which has an issue.


Solution

  • This issue was fixed by upgrading Net::SSH::Perl to v1.41 Thanks for the tip @daxim