[Ssh-sftp-perl-users] RE : Ssh-sftp-perl-users digest, Vol 1 #108 - 5 msgs
Brought to you by:
dbrobins
From: <Fra...@gl...> - 2005-07-07 06:10:43
|
Hi, I'm facing the same problem as Steve Neuharth Please find below the problem's description :=20 I want my perl program to connect to a server using SSH. I want to connect to remote servers I've never been before. In fact, the program's aim will be to copy a public key on several = remote servers. Here is the error raised by perl : Not an ARRAY = reference at /usr/local/share/perl/5.8.4/Math/BigInt/Calc.pm line 222. = As far as I am concerned I had lots of difficulties to get the = Net:SSH:perl lib to compile through the cpan shell. Here is my code : = $adresse_ip=3D"192.168.100.54"; $user=3D"user"; $pass=3D"xxxx"; = $params{debug} =3D 1; $params{interactive} =3D 0; $params{protocol} =3D = '2,1'; $ssh =3D Net::SSH::Perl->new($adresse_ip,%params,options =3D>["BatchMode = yes","RhostsRSAAuthentication no"]); $ssh->login($user, $pass); = ($stdout, $stderr, $exit) =3D $ssh->cmd("ls"); print $stdout; print = $stderr; print $exit; Here is the debug output :=20 Reading configuration data /home/kudjat/.ssh/config Reading configuration data /etc/ssh_config Connecting to 195.110.248.210, port 22. Remote protocol version 2.0, remote software version OpenSSH_3.7.1p1 = Net::SSH::Perl Version 1.28, protocol version 2.0. No compat match: = OpenSSH_3.7.1p1. 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-dss'. Host '195.110.248.210' is known and matches the = host key. Not an ARRAY reference at = /usr/local/share/perl/5.8.4/Math/BigInt/Calc.pm line 222. Many thanks for your help. Regards, Fran=E7ois PS : I am running perl on a Debian 2.4.27-1-386 Perl version is 5.8.4 CPAN version is 1.7601 Net::SSH::Perl Version 1.28, protocol version 2.0. -----Message d'origine----- De : ssh...@li... = [mailto:ssh...@li...] De la part de = ssh...@li... Envoy=E9 : jeudi 7 juillet 2005 05:38 =C0 : ssh...@li... Objet : Ssh-sftp-perl-users digest, Vol 1 #108 - 5 msgs Send Ssh-sftp-perl-users mailing list submissions to ssh...@li... To subscribe or unsubscribe via the World Wide Web, visit https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users or, via email, send a message with subject or body 'help' to ssh...@li... You can reach the person managing the list at ssh...@li... When replying, please edit your Subject line so it is more specific than = "Re: Contents of Ssh-sftp-perl-users digest..." Today's Topics: 1. RE: Slow Authentication (Yishay Weiss) 2. Not an ARRAY reference at /usr/lib/perl5/5.8.5/Math/BigInt/Calc.pm line 968 (Steve Neuharth) 3. Re: Not an ARRAY reference at = /usr/lib/perl5/5.8.5/Math/BigInt/Calc.pm line 968 (Steve Neuharth) --__--__-- Message: 1 From: "Yishay Weiss" <yis...@ho...> To: ssh...@li... Subject: RE: [Ssh-sftp-perl-users] Slow Authentication Date: Wed, 06 Jul 2005 13:15:55 +0000 I'm having the same problem using. I ran your script and am having the = same=20 results using 5.8.7 on Red Hat Enterprise Linux AS release 3 (Taroon). Using 5.8.4 on Windows XP your script runs quick and there's no problem. >From: "Eric Langheinrich" <net...@er...> >To: <ssh...@li...> >Subject: [Ssh-sftp-perl-users] Slow Authentication >Date: Mon, 4 Jul 2005 16:15:34 -0600 > >I'm having some trouble with slow logins using Net::SSH::Perl. I've=20 >used >the module on other machines in the past and love what I can do with = it,=20 >but the slow authentication I'm seeing currently is a pain. > >I'm using Perl 5.8.0 with the latest versions of the modules downloaded >from CPAN. Machine is a dual XEON with 64 Bit Redhat Enterprise 3.1=20 >installed. Tried installing using MCPAN and also manually downloading = and=20 >installing each module. Didn't seem to help. > >To try and narrow things down, I've put a little script together that >simply goes and performs an 'ls' on the remote machine. > >use strict; >use Net::SSH::Perl; >use vars qw($ssh); > > >my @ident =3D ( "/home/user/.ssh/id_dsa"); >my %params =3D ( > protocol =3D> 2, > interactive =3D> 0, > identity_files =3D> [@ident], > debug =3D> 1, > options =3D> [ > "BatchMode yes", > "AuthenticationSuccessMsg no", > "ForwardX11 no", > "ForwardAgent no" > ] >); > >my $server =3D $ARGV[0]; >&sshconnect($server); >my ($stdout, $stderr, $exit) =3D $ssh->cmd("ls"); >print "$stdout\n"; >if (! $ssh) { > print "Unable to establish ssh connection to: $server\n"; }=20 >else { > print "Successfully established ssh connection to: $server\n"; = >} > >sub sshconnect { > my $server =3D $_[0]; > our $ssh =3D Net::SSH::Perl->new("$server", %params); > $ssh->login("user"); >} > > >Output with the debug flag is as follows: > >d: Reading configuration data /root/.ssh/config >d: Reading configuration data /etc/ssh_config >d: Allocated local port 1022. >d: Connecting to remote1, port 22. >d: Remote protocol version 2.0, remote software version OpenSSH_3.6.1p2 >d: Net::SSH::Perl Version 1.28, protocol version 2.0. >d: No compat match: OpenSSH_3.6.1p2. >d: Connection established. >d: Sent key-exchange init (KEXINIT), wait response. >d: Algorithms, c->s: 3des-cbc hmac-sha1 none >d: Algorithms, s->c: 3des-cbc hmac-sha1 none >d: Entering Diffie-Hellman Group 1 key exchange. >d: Sent DH public key, waiting for reply. >d: Received host key, type 'ssh-dss'. >d: Host 'remote1' is known and matches the host key. >d: Computing shared secret key. >d: Verifying server signature. >d: Waiting for NEWKEYS message. >d: Enabling incoming encryption/MAC/compression. >d: Send NEWKEYS, enable outgoing encryption/MAC/compression. >d: Sending request for user-authentication service. >d: Service accepted: ssh-userauth. >d: Trying empty user-authentication request. >d: Authentication methods that can continue: >publickey,password,keyboard-interactive. >d: Next method to try is publickey. >d: Trying pubkey authentication with key file '/home/user/.ssh/id_dsa' >d: Login completed, opening dummy shell channel. >d: channel 0: new [client-session] >d: Requesting channel_open for channel 0. >d: channel 0: open confirm rwindow 0 rmax 32768 >d: Got channel open confirmation, requesting shell. >d: Requesting service shell on channel 0. >d: channel 1: new [client-session] >d: Requesting channel_open for channel 1. >d: Entering interactive session. >d: Sending command: ls >d: Requesting service exec on channel 1. >d: channel 1: open confirm rwindow 0 rmax 32768 >d: input_channel_request: rtype exit-status reply 0 >d: channel 1: rcvd eof >d: channel 1: output open -> drain >d: channel 1: rcvd close >d: channel 1: input open -> closed >d: channel 1: close_read >d: channel 1: obuf empty >d: channel 1: output drain -> closed >d: channel 1: close_write >d: channel 1: send close >d: channel 1: full closed >authorized_keys >sites > >Successfully established ssh connection to: remote1 > > >The delay seems to happen primarily in two places. First at the line:=20 >d: >Algorithms, s->c: 3des-cbc hmac-sha1 none >which takes 10 seconds or so, then again at: d: Computing shared secret = >key. > >Which again takes 10 or 15 seconds. > >Any help would be greatly appreciated. I'd like to not have to rewrite=20 >the >whole process to use Net::SSH _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's = FREE!=20 http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ --__--__-- Message: 2 Date: Wed, 06 Jul 2005 16:26:44 -0500 From: Steve Neuharth <ste...@vi...> To: ssh...@li... Subject: [Ssh-sftp-perl-users] Not an ARRAY reference at = /usr/lib/perl5/5.8.5/Math/BigInt/Calc.pm line 968 here's my script: #!/usr/bin/perl use strict ; use lib '/opt/lib/perl' ; use Net::SFTP qw(scp) ; my %sftpArgs =3D ( user =3D> 'user', password =3D> 'password', warn =3D> '0', debug =3D> '1', ) ; my $sftp =3D Net::SFTP -> new('127.0.0.1', %sftpArgs) ; $sftp -> put("/etc/passwd", "/tmp") ; Here's what happens.... [root@pnazlx236 ~]# perl test.pl pnazlx236.nat.teci.com: Reading configuration data /root/.ssh/config pnazlx236.nat.teci.com: Reading configuration data /etc/ssh_config pnazlx236.nat.teci.com: Allocated local port 1023. pnazlx236.nat.teci.com: Connecting to 127.0.0.1, port 22. pnazlx236.nat.teci.com: Remote protocol version 1.99, remote software=20 version OpenSSH_3.9p1 pnazlx236.nat.teci.com: Net::SSH::Perl Version 1.28, protocol version = 2.0. pnazlx236.nat.teci.com: No compat match: OpenSSH_3.9p1. pnazlx236.nat.teci.com: Connection established. pnazlx236.nat.teci.com: Sent key-exchange init (KEXINIT), wait response. pnazlx236.nat.teci.com: Algorithms, c->s: 3des-cbc hmac-sha1 none pnazlx236.nat.teci.com: Algorithms, s->c: 3des-cbc hmac-sha1 none pnazlx236.nat.teci.com: Entering Diffie-Hellman Group 1 key exchange. pnazlx236.nat.teci.com: Sent DH public key, waiting for reply. pnazlx236.nat.teci.com: Received host key, type 'ssh-dss'. pnazlx236.nat.teci.com: Host '127.0.0.1' is known and matches the host = key. Not an ARRAY reference at /usr/lib/perl5/5.8.5/Math/BigInt/Calc.pm = line 968. what's with BigInt? I'm running RHEL4, kernel 2.6.9-11.ELsmp, perl 5.8 and modules compiled=20 from CPAN. --__--__-- Message: 3 Date: Wed, 06 Jul 2005 17:24:12 -0500 From: Steve Neuharth <ste...@vi...> To: ssh...@li... Subject: Re: [Ssh-sftp-perl-users] Not an ARRAY reference at = /usr/lib/perl5/5.8.5/Math/BigInt/Calc.pm line 968 strange, installing Math::BigInt::GMP fixed it but I don't see that=20 listed as a dependency anywhere. Did I miss something in the docs? Steve Neuharth wrote: > here's my script: > > #!/usr/bin/perl > > use strict ; > use lib '/opt/lib/perl' ; > use Net::SFTP qw(scp) ; > > my %sftpArgs =3D ( > user =3D> 'user', > password =3D> 'password', > > warn =3D> '0', > debug =3D> '1', > ) ; > > my $sftp =3D Net::SFTP -> new('127.0.0.1', %sftpArgs) ; > $sftp -> put("/etc/passwd", "/tmp") ; > > Here's what happens.... > > [root@pnazlx236 ~]# perl test.pl > pnazlx236.nat.teci.com: Reading configuration data /root/.ssh/config > pnazlx236.nat.teci.com: Reading configuration data /etc/ssh_config > pnazlx236.nat.teci.com: Allocated local port 1023. > pnazlx236.nat.teci.com: Connecting to 127.0.0.1, port 22. > pnazlx236.nat.teci.com: Remote protocol version 1.99, remote software > version OpenSSH_3.9p1 > pnazlx236.nat.teci.com: Net::SSH::Perl Version 1.28, protocol version=20 > 2.0. > pnazlx236.nat.teci.com: No compat match: OpenSSH_3.9p1. > pnazlx236.nat.teci.com: Connection established. > pnazlx236.nat.teci.com: Sent key-exchange init (KEXINIT), wait = response. > pnazlx236.nat.teci.com: Algorithms, c->s: 3des-cbc hmac-sha1 none > pnazlx236.nat.teci.com: Algorithms, s->c: 3des-cbc hmac-sha1 none > pnazlx236.nat.teci.com: Entering Diffie-Hellman Group 1 key exchange. > pnazlx236.nat.teci.com: Sent DH public key, waiting for reply. > pnazlx236.nat.teci.com: Received host key, type 'ssh-dss'. > pnazlx236.nat.teci.com: Host '127.0.0.1' is known and matches the host = > key. > Not an ARRAY reference at /usr/lib/perl5/5.8.5/Math/BigInt/Calc.pm=20 > line 968. > > what's with BigInt? > > I'm running RHEL4, kernel 2.6.9-11.ELsmp, perl 5.8 and modules > compiled from CPAN. > > > > ------------------------------------------------------- > SF.Net email is sponsored by: Discover Easy Linux Migration Strategies = > from IBM. Find simple to follow Roadmaps, straightforward articles,=20 > informative Webcasts and more! Get everything you need to get up to=20 > speed, fast. = http://ads.osdn.com/?ad_id=3D7477&alloc_id=3D16492&op=3Dclick > _______________________________________________ > Ssh-sftp-perl-users mailing list=20 > Ssh...@li... > https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users > --__--__-- _______________________________________________ Ssh-sftp-perl-users mailing list = Ssh...@li... https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users End of Ssh-sftp-perl-users Digest This email communication is confidential and is intended solely for whom = it is addressed. Copying, or re-using in any way by anyone else is = unauthorised. Any views or opinions expressed are those of the author = and do not necessarily represent those of GL TRADE or any of its = affiliates.=20 If you have received this mail in error, please destroy the copy in your = possession and notify ab...@gl... |