CPAN::Forum
Net-SFTP - strange problem conecting to an HP switch
| Posted on Tue Mar 11 15:17:59 2008 by grocanar |
| strange problem conecting to an HP switch |
|
i m not able to connect to an hp switch using the Net:SFTP module.
it works with the sftp command
#!/usr/bin/perl
use Net::SFTP;
$
$user="******";
$pass="********";
$remote="running-config";
$remotepath="cfg/running-config";
%PARM = (
user => $user,
password => $pass,
debug => 1,
options => [
"PubkeyAuthentication no" ],
);
@HOST=('157.159.x.x');
foreach $host (@HOST)
{
print "On traite $host\n";
my $sftp = Net::SFTP->new($host ,%PARM);
$local= $remote . $host;
$sftp->get($remotepath , $local , \&callback );
}
Here is the output i got
On traite 157.159.7.60 sw-A01
admreseau.int-evry.fr: Reading configuration data /root/.ssh/config
admreseau.int-evry.fr: Reading configuration data /etc/ssh_config
admreseau.int-evry.fr: Allocated local port 1023.
admreseau.int-evry.fr: Connecting to 157.159.7.60 sw-A01, port 22.
admreseau.int-evry.fr: Remote version string: SSH-2.0-OpenSSH_3.7.1p2
admreseau.int-evry.fr: Remote protocol version 2.0, remote software version OpenSSH_3.7.1p2
admreseau.int-evry.fr: Net::SSH::Perl Version 1.30, protocol version 2.0.
admreseau.int-evry.fr: No compat match: OpenSSH_3.7.1p2.
admreseau.int-evry.fr: Connection established.
admreseau.int-evry.fr: Sent key-exchange init (KEXINIT), wait response.
admreseau.int-evry.fr: Algorithms, c->s: 3des-cbc hmac-sha1 none
admreseau.int-evry.fr: Algorithms, s->c: 3des-cbc hmac-sha1 none
admreseau.int-evry.fr: Entering Diffie-Hellman Group 1 key exchange.
admreseau.int-evry.fr: Sent DH public key, waiting for reply.
Key class 'Net::SSH::Perl::Key::RSA' is unsupported: Base class package "Class::ErrorHandler" is em
+pty.
(Perhaps you need to 'use' the module which defines that package first.)
at /usr/lib/perl5/vendor_perl/5.8.8/Convert/PEM.pm line 5
BEGIN failed--compilation aborted at /usr/lib/perl5/vendor_perl/5.8.8/Convert/PEM.pm line 5.
Compilation failed in require at /usr/lib/perl5/vendor_perl/5.8.8/Net/SSH/Perl/Key/RSA.pm line 21.
BEGIN failed--compilation aborted at /usr/lib/perl5/vendor_perl/5.8.8/Net/SSH/Perl/Key/RSA.pm line
+21.
Compilation failed in require at (eval 24) line 1.
BEGIN failed--compilation aborted at (eval 24) line 1.
If i connect to a linux machine it work
On traite elaphe.int-evry.fr
admreseau.int-evry.fr: Reading configuration data /root/.ssh/config
admreseau.int-evry.fr: Reading configuration data /etc/ssh_config
admreseau.int-evry.fr: Allocated local port 1023.
admreseau.int-evry.fr: Connecting to elaphe.int-evry.fr, port 22.
admreseau.int-evry.fr: Remote version string: SSH-2.0-OpenSSH_4.5
admreseau.int-evry.fr: Remote protocol version 2.0, remote software version OpenSSH_4.5
admreseau.int-evry.fr: Net::SSH::Perl Version 1.30, protocol version 2.0.
admreseau.int-evry.fr: No compat match: OpenSSH_4.5.
admreseau.int-evry.fr: Connection established.
admreseau.int-evry.fr: Sent key-exchange init (KEXINIT), wait response.
admreseau.int-evry.fr: Algorithms, c->s: 3des-cbc hmac-sha1 none
admreseau.int-evry.fr: Algorithms, s->c: 3des-cbc hmac-sha1 none
admreseau.int-evry.fr: Entering Diffie-Hellman Group 1 key exchange.
admreseau.int-evry.fr: Sent DH public key, waiting for reply.
admreseau.int-evry.fr: Received host key, type 'ssh-dss'.
admreseau.int-evry.fr: Host 'elaphe.int-evry.fr' is known and matches the host key.
admreseau.int-evry.fr: Computing shared secret key.
admreseau.int-evry.fr: Verifying server signature.
admreseau.int-evry.fr: Waiting for NEWKEYS message.
admreseau.int-evry.fr: Enabling incoming encryption/MAC/compression.
admreseau.int-evry.fr: Send NEWKEYS, enable outgoing encryption/MAC/compression.
admreseau.int-evry.fr: Sending request for user-authentication service.
admreseau.int-evry.fr: Service accepted: ssh-userauth.
admreseau.int-evry.fr: Trying empty user-authentication request.
admreseau.int-evry.fr: Authentication methods that can continue: publickey,gssapi-with-mic,password
+.
admreseau.int-evry.fr: Next method to try is publickey.
admreseau.int-evry.fr: Next method to try is password.
admreseau.int-evry.fr: Trying password authentication.
admreseau.int-evry.fr: Login completed, opening dummy shell channel.
admreseau.int-evry.fr: channel 0: new [client-session]
admreseau.int-evry.fr: Requesting channel_open for channel 0.
admreseau.int-evry.fr: channel 0: open confirm rwindow 0 rmax 32768
admreseau.int-evry.fr: channel 1: new [client-session]
admreseau.int-evry.fr: Requesting channel_open for channel 1.
admreseau.int-evry.fr: Sending subsystem: sftp
admreseau.int-evry.fr: Requesting service subsystem on channel 1.
admreseau.int-evry.fr: channel 1: open confirm rwindow 0 rmax 32768
does someone know how to sove the problem?
|
| Write a response |
(2)
]