The script below is trying to connect to a Cisco router, and is
giving the error messages that follow.
The same code when aimed at a linux server, changing only the host,
user, password and command works fine.
Any suggestions are appreciated.
#
use strict;
use Net::SSH::Perl;
use Net::SSH::Perl::Cipher;
my $port = "ssh";
my $host ="xxx.xx.x.x";
my $user = "xxxxxxxxx";
my $pass = "xxxxxx";
my $cmd = "show version";
my $ssh = Net::SSH::Perl->new($host,
debug => 1);
$ssh->login($user, $pass);
my($out, $err) = $ssh->cmd($cmd);
==============================================
root@ivan #./test.pl
Reading configuration data /root/.ssh/config
Reading configuration data /etc/ssh_config
Allocated local port 1023.
Connecting to XXX.XXX.XXX port 22
Remote protocol version 2.0, remote software version Cisco-1.25
Net::SSH::Perl Version 1.28, protocol version 2.0.
No compat match: Cisco-1.25.
Connection established.
Sent key-exchange init (KEXINIT), wait response.
Algorithms, c->s: 3des-cbc hmac-sha1 none
Algorithms, s->c: 3des-cbc hmac-sha1 none
Entering Diffie-Hellman Group 1 key exchange.
Sent DH public key, waiting for reply.
Received host key, type "ssh-rsa".
Host "172.20.6.3" is known and matches the host key.
Computing shared secret key.
Verifying server signature.
Waiting for NEWKEYS message.
Enabling incoming encryption/MAC/compression.
Send NEWKEYS, enable outgoing encryption/MAC/compression.
Sending request for user-authentication service.
Service accepted: ssh-userauth.
Trying empty user-authentication request.
Authentication methods that can continue: password.
Next method to try is password.
Trying password authentication.
Login completed, opening dummy shell channel.
channel 0: new [client-session]
Requesting channel_open for channel 0.
channel 0: open confirm rwindow 1024 rmax 4096
Got channel open confirmation, requesting shell.
Requesting service shell on channel 0.
channel 1: new [client-session]
Requesting channel_open for channel 1.
Entering interactive session.
Channel open failure: 1: reason 4:
(10)
]
