[Ssh-sftp-perl-users] very slow connection with ssh version 2
Brought to you by:
dbrobins
From: Miky J <mi...@ya...> - 2006-01-02 10:25:37
|
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 (==) 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="the_host"; my $login='root'; my $password='the_password'; my $commande='ps -ef'; login($login,$password,$host, $commande); sub login { my ($login, $password, $host, $cmd) = @_; my $dump = 'dump.txt'; open (DUMP, ">>$dump") or die "Impossible d'ouvrir le fichier $dump"; print "Trying to log in\n"; # Force version 2 my $ssh = Net::SSH::Perl->new($host, protocol=>'2', port=>22, debug=>"true"); print "Sending password and loggin : $login, $password\n"; $ssh->login($login, $password); print "Loggin OK\n"; my($resultat, $stderr, $exit) = $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éléphonez moins cher avec Yahoo! Messenger ! Découvez les tarifs exceptionnels pour appeler la France et l'international. Téléchargez sur http://fr.messenger.yahoo.com |