briandfoy / net-ssh-perl

Development on the Net::SSH::Perl module to support latest ciphers, key exchange mechanisms, etc.
Other
4 stars 1 forks source link

Can't locate object method "ssh_name" via package "Net::SSH::Perl::Key::RSA1 #58

Open briandfoy opened 1 year ago

briandfoy commented 1 year ago

This ticket was imported from rt.cpan.org 120663

Login credentials passed to the program were checked and verified.

Red Hat 6.8 perl, v5.10.1

Perl code below:

use Net::SSH::Perl;

$host = 'xxx';
$user= 'xxx';
$password = 'xxx';
$cmd='uptime';
my $ssh = Net::SSH::Perl->new($host, debug => 1);
$ssh->login($user, $password);
my($stdout, $stderr, $exit) = $ssh->cmd($cmd);
print "$stdout, $stderr, $exit\n";

DEBUG OUTPUT:

[root@perl]# ./ssh.pl
server.com: Reading configuration data /root/.ssh/config
server.com: Reading configuration data /etc/ssh_config
server.com: Allocated local port 1023.
server.com: Connecting to xxxl.com, port 22.
server.com: Remote version string: SSH-1.99-OpenSSH_3.9p1
servercom: Remote protocol version 1.99, remote software version 
OpenSSH_3.9p1
server.com: Net::SSH::Perl Version 2.09, protocol version 1.5.
server.com: No compat match: OpenSSH_3.9p1.
server.com: Connection established.
server.com: Waiting for server public key.
server.com: Received server public key (768 bits) and host key (1024 bits).
Can't locate object method "ssh_name" via package 
"Net::SSH::Perl::Key::RSA1" at 
/usr/local/lib64/perl5/Net/SSH/Perl/Util/Hosts.pm line 55, <$fh> line 16.
briandfoy commented 1 year ago

from schwigon@cpan.org


Is this still a problem with v2.14?

Kind regards, Steffen

briandfoy commented 1 year ago

from tony@metracom.com


I don't know.

briandfoy commented 1 year ago

from d15b200@gmail.com


dmin-PC: Reading configuration data C:\Users\Admin\.ssh\config
Admin-PC: Reading configuration data C:\Windows\ssh_config
Admin-PC: Connecting to 10.103.xxx.xxx, port 22.
Admin-PC: Remote version string: SSH-1.99-Cisco-1.25
Admin-PC: Remote protocol version 1.99, remote software version Cisco-1.25
Admin-PC: Net::SSH::Perl Version 2.14, protocol version 1.5.
Admin-PC: No compat match: Cisco-1.25.
Admin-PC: Connection established.
Admin-PC: Waiting for server public key.
Admin-PC: Received server public key (768 bits) and host key (1024 bits).
Can't locate object method "ssh_name" via package "Net::SSH::Perl::Key::RSA1"
        at c:/Dwimperl/perl/site/lib/Net/SSH/Perl/Util/Hosts.pm line 56, <$fh> line 1 (#1)
    (F) You called a method correctly, and it correctly indicated a package
    functioning as a class, but that package doesn't define that particular
    method, nor does any of its base classes.  See perlobj.

Uncaught exception from user code:
        Can't locate object method "ssh_name" via package "Net::SSH::Perl::Key::RSA1" at c:/Dwimperl/perl/site/lib/Net/SSH/Perl/Util/Hosts.pm line 56, <$fh> line 1. at c:/Dwimperl/perl/site/lib/Net/SSH/Perl/Util/Hosts.pm line 56
        Net::SSH::Perl::Util::Hosts::_check_host_in_hostfile(10.103.xxx.xxx, undef, 'C:\Users\Admin\.ssh\known_hosts', 'Net::SSH::Perl::Key::RSA1=HASH(0x2f05edc)') called at c:/Dwimperl/perl/site/lib/Net/SSH/Perl.pm line 417
        Net::SSH::Perl::check_host_key('Net::SSH::Perl::SSH1=HASH(0x4fbdec)', 'Net::SSH::Perl::Key::RSA1=HASH(0x2f05edc)') called at c:/Dwimperl/perl/site/lib/Net/SSH/Perl/SSH1.pm line 112
        Net::SSH::Perl::SSH1::_login('Net::SSH::Perl::SSH1=HASH(0x4fbdec)') called at c:/Dwimperl/perl/site/lib/Net/SSH/Perl/SSH1.pm line 204
        Net::SSH::Perl::SSH1::_setup_connection('Net::SSH::Perl::SSH1=HASH(0x4fbdec)') called at c:/Dwimperl/perl/site/lib/Net/SSH/Perl/SSH1.pm line 264
        Net::SSH::Perl::SSH1::cmd('Net::SSH::Perl::SSH1=HASH(0x4fbdec)', 'show ip int br') called at ssh.pl line 35