[Ssh-sftp-perl-users] Using Net::SSH::Perl to connecto foundry switches
Brought to you by:
dbrobins
From: Mark P. <m.p...@au...> - 2008-04-18 04:16:27
|
Hi, I am just a newbie in using this PERL Module and after a lot of googling, can't still find the answer, hence my email to you guys. I am writing a perl script that would ssh to our foundry boxes. Here is the my test code below require Exporter; @ISA = qw(Exporter); use strict; use warnings 'all'; use Net::SSH::Perl; login_foundry('192.168.11.250', '', 'enable'); sub login_foundry { my ($host,$extra,$rad_com) = @_; return '' if !defined $host; my $user = 'mark'; my $pass = 'password'; my %param; $param{debug}='true'; $param{protocol}=2; my $ssh = Net::SSH::Perl->new($host, %param); $ssh->login($user, $pass); my($stdout, $stderr, $exit) = $ssh->cmd($rad_com); } 1; But when I execute this script, Here is the result: stibbons: Reading configuration data /home/mark/.ssh/config stibbons: Reading configuration data /etc/ssh_config stibbons: Connecting to 192.168.11.250, port 22. stibbons: Remote version string: SSH-2.0-RomSShell_4.31 stibbons: Remote protocol version 2.0, remote software version RomSShell_4.31 stibbons: Net::SSH::Perl Version 1.30, protocol version 2.0. stibbons: No compat match: RomSShell_4.31 stibbons: Connection established. stibbons: output stibbons: Sent key-exchange init (KEXINIT), wait response. stibbons: Algorithms, c->s: 3des-cbc hmac-sha1 none stibbons: Algorithms, s->c: 3des-cbc hmac-sha1 none stibbons: Entering Diffie-Hellman Group 1 key exchange. stibbons: Sent DH public key, waiting for reply. stibbons: Received host key, type 'ssh-dss'. stibbons: Host '192.168.11.250' is known and matches the host key. stibbons: Computing shared secret key. stibbons: Verifying server signature. stibbons: Waiting for NEWKEYS message. Connection closed by remote host. at /usr/lib/perl5/site_perl/5.8.5/Net/SSH/Perl/Kex.pm line 103 Do you have any idea why is this happening? Your help is mostly appreciated. Cheers, Mark |