Re: [Ssh-sftp-perl-users] very slow connection with ssh version 2
Brought to you by:
dbrobins
|
From: elec <ele...@gm...> - 2006-01-02 16:56:25
|
read the previous threads....you need a to add a package
Math::BigInt::GMP
perl -MCPAN -e "install Math::BigInt::GMP"
On 1/2/06, Miky J <mi...@ya...> wrote:
>
> Hello and happy new year,
>
> I'm trying to automatise a logging script to check the
> config on many linux machines.
>
> - Some machines use SSH 1 and 2, by default it's the
> version 1 and
> I have a warning coming from the perl module.
> Argument "ssh-rsa" isn't numeric in numeric eq (=3D=3D) at
> /usr/lib/perl5/site_perl/5.8.6/Net/SSH/Perl/Key/RSA1.pm
> line 94, <FH> line 20.
>
> - By default I'd like to use SSH 2 all the time but
> it's very slow to log in, more than one minute. But
> when i do
> $ssh -2 root@the_host
> it's fast.
>
> My Debug
> --------
>
> $ ./newssh.pl
> Trying to log in
> admin: Reading configuration data
> /home/mikydeb/.ssh/config
> admin: Reading configuration data /etc/ssh_config
> admin: Connecting to the_host, port 22.
> admin: Remote protocol version 1.99, remote software
> version OpenSSH_3.6.1p2
> admin: Net::SSH::Perl Version 1.29, protocol version
> 2.0.
> admin: No compat match: OpenSSH_3.6.1p2.
> admin: Connection established.
> envoi password et loggin : root, the_password
> admin: Sent key-exchange init (KEXINIT), wait
> response.
> admin: Algorithms, c->s: 3des-cbc hmac-sha1 none
> admin: Algorithms, s->c: 3des-cbc hmac-sha1 none
>
> <---25 seconds--->
>
> admin: Entering Diffie-Hellman Group 1 key exchange.
> admin: Sent DH public key, waiting for reply.
> admin: Received host key, type 'ssh-dss'.
> admin: Host 'the_host' is known and matches the host
> key.
> admin: Computing shared secret key.
>
> <---25 seconds--->
>
> admin: Verifying server signature.
>
> <---10 seconds--->
>
> admin: Waiting for NEWKEYS message.
> admin: Enabling incoming encryption/MAC/compression.
> admin: Send NEWKEYS, enable outgoing
> encryption/MAC/compression.
> admin: Sending request for user-authentication
> service.
> admin: Service accepted: ssh-userauth.
> admin: Trying empty user-authentication request.
> admin: Authentication methods that can continue:
> publickey,password,keyboard-interactive.
> admin: Next method to try is publickey.
> admin: Trying pubkey authentication with key file
> '/home/mikydeb/.ssh/id_dsa'
> admin: Authentication methods that can continue:
> publickey,password,keyboard-interactive.
> admin: Next method to try is publickey.
> admin: Next method to try is password.
> admin: Trying password authentication.
> admin: Login completed, opening dummy shell channel.
> admin: channel 0: new [client-session]
> admin: Requesting channel_open for channel 0.
> admin: channel 0: open confirm rwindow 0 rmax 32768
> admin: Got channel open confirmation, requesting
> shell.
> admin: Requesting service shell on channel 0.
> Loggin OK
> admin: channel 1: new [client-session]
> admin: Requesting channel_open for channel 1.
> admin: Entering interactive session.
> admin: Sending command: ps -ef
> admin: Requesting service exec on channel 1.
> admin: channel 1: open confirm rwindow 0 rmax 32768
> admin: input_channel_request: rtype exit-status reply
> 0
> admin: channel 1: rcvd eof
> admin: channel 1: output open -> drain
> admin: channel 1: rcvd close
> admin: channel 1: input open -> closed
> admin: channel 1: close_read
> admin: channel 1: obuf empty
> admin: channel 1: output drain -> closed
> admin: channel 1: close_write
> admin: channel 1: send close
> admin: channel 1: full closed
>
>
> My script
> ---------
>
> #!/usr/bin/perl -w
>
> my $host=3D"the_host";
> my $login=3D'root';
> my $password=3D'the_password';
> my $commande=3D'ps -ef';
>
> login($login,$password,$host, $commande);
>
> sub login
> {
> my ($login, $password, $host, $cmd) =3D @_;
> my $dump =3D 'dump.txt';
> open (DUMP, ">>$dump") or die "Impossible d'ouvrir
> le fichier $dump";
>
> print "Trying to log in\n";
> # Force version 2
> my $ssh =3D Net::SSH::Perl->new($host, protocol=3D>'2',
> port=3D>22, debug=3D>"true");
>
> print "Sending password and loggin : $login,
> $password\n";
> $ssh->login($login, $password);
> print "Loggin OK\n";
>
> my($resultat, $stderr, $exit) =3D $ssh->cmd($cmd);
> print DUMP "$host\t$resultat";
> close DUMP;
> }
>
>
> Do you have any idea of what causes this, is it a
> problem in my script ? or maybe on the server ?
>
>
>
>
>
>
>
> _________________________________________________________________________=
__
> Nouveau : t=E9l=E9phonez moins cher avec Yahoo! Messenger ! D=E9couvez le=
s
> tarifs exceptionnels pour appeler la France et l'international.
> T=E9l=E9chargez sur http://fr.messenger.yahoo.com
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log
> files
> for problems? Stop! Download the new AJAX search engine that makes
> searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
> http://ads.osdn.com/?ad_id=3D7637&alloc_id=3D16865&op=3Dclick
> _______________________________________________
> Ssh-sftp-perl-users mailing list
> Ssh...@li...
> https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users
>
|