I have been using the SSH package of Perl to connect to my RHEL systems. I recently upgraded one of my VM to redhat-release-server-7.2-9.el7.x86_64. Now when I am running my Perl script it is throwing the error:
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.
The same script is otherwise working on my 6.8 RHEL version. Any suggestions?
Here is the code:
#!/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");
Debug print:
[root@Automation_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 curve25519-sha256@libssh.org for key exchange
Automation_linux_[Auto_server_ip]: Host key algorithm: ssh-ed25519
Automation_linux_[Auto_server_ip]: Algorithms, c->s: chacha20-poly1305@openssh.com <implicit> none
Automation_linux_[Auto_server_ip]: Algorithms, s->c: chacha20-poly1305@openssh.com <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.