RE: [Ssh-sftp-perl-users] Slow Authentication
Brought to you by:
dbrobins
From: Yishay W. <yis...@ho...> - 2005-07-06 13:16:47
|
I'm having the same problem using. I ran your script and am having the same 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 used >the module on other machines in the past and love what I can do with it, >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 >installed. Tried installing using MCPAN and also manually downloading and >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 = ( "/home/user/.ssh/id_dsa"); >my %params = ( > protocol => 2, > interactive => 0, > identity_files => [@ident], > debug => 1, > options => [ > "BatchMode yes", > "AuthenticationSuccessMsg no", > "ForwardX11 no", > "ForwardAgent no" > ] >); > >my $server = $ARGV[0]; >&sshconnect($server); >my ($stdout, $stderr, $exit) = $ssh->cmd("ls"); >print "$stdout\n"; >if (! $ssh) { > print "Unable to establish ssh connection to: $server\n"; >} else { > print "Successfully established ssh connection to: $server\n"; >} > >sub sshconnect { > my $server = $_[0]; > our $ssh = 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: 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 the >whole process to use Net::SSH _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ |