Thread: [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 |
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 > |
From: Miky J <mi...@ya...> - 2006-01-08 11:20:38
|
Thanx, it solved the issue --- elec <ele...@gm...> a écrit : > 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 > (==) 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 > > > > > > > ------------------------------------------------------- > > 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=7637&alloc_id=16865&op=click > > _______________________________________________ > > Ssh-sftp-perl-users mailing list > > Ssh...@li... > > > https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users > > > ___________________________________________________________________________ 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 |
From: Miky J <mi...@ya...> - 2006-01-09 10:12:19
|
Hi, I'm not the only one to log on some machines and sometimes passwords change here. When I do $ssh->login($login, $password); with $password='wrong password' I'd like my script to make a second attempt with $password='good password' I have tryed if ($ssh->login($login, $password)) { ... } else { retry to connect } but it didn't work. Does anyone know how to do that ? ___________________________________________________________________________ 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 |
From: Rafe S. <raf...@iq...> - 2006-01-09 10:56:00
|
Miky J wrote: >Hi, > >I'm not the only one to log on some machines and >sometimes passwords change here. > >When I do >$ssh->login($login, $password); >with $password='wrong password' >I'd like my script to make a second attempt with >$password='good password' > >I have tryed >if ($ssh->login($login, $password)) { ... } >else { retry to connect } > >but it didn't work. > >Does anyone know how to do that ? > > > > If I remember correctly, the ssh lib dies the script after a login attempt fails... so you need to wrap the login attempt in an eval and then try with a new password if it fails..... If you search the list archives I'm pretty certain its there.... In fact, if memory serves I asked that very question about 18 months ago :-> (I did a debug step through the code and found the die line) apologies for the piss poor code :-> I think you could just put in a second login attempt where I have the write_results sub below. Rafe use Net::SSH::Perl; eval { local $SIG{ALRM} = sub { write_results( $opt{C}, 2, "Timeout Failure", 1 ) }; alarm $TIMEOUT; $ssh = Net::SSH::Perl->new( $host, options => [ "Debug 1", "Protocol 2" ] ); } || write_results( $opt{C}, 2, "Connection Failure", 1 ); eval { $pwd = $ssh->login( $username, $password ) }; if ( !$@ ) { my $cmd = q( uname); my ( $stdout, $stderr, $exit ) = $ssh->cmd($cmd); # print "host: $stdout\n"; chomp($stdout); if ( $stdout eq "Linux" ) { $cmd = "ps -ef |grep -i \"$process\" |grep -v grep |grep -v process.pl"; } else { $cmd = "/usr/ucb/ps -auxww |grep -i \"$process\" |grep -v grep |grep -v process.pl"; } ( $stdout, $stderr, $exit ) = $ssh->cmd($cmd); |
From: Miky J <mi...@ya...> - 2006-01-09 15:52:27
|
Thanx, eval did the job great for me. I'm quite new with perl so I didn't know eval. --- Rafe Slattery <raf...@iq...> a écrit : > Miky J wrote: > > >Hi, > > > >I'm not the only one to log on some machines and > >sometimes passwords change here. > > > >When I do > >$ssh->login($login, $password); > >with $password='wrong password' > >I'd like my script to make a second attempt with > >$password='good password' > > > >I have tryed > >if ($ssh->login($login, $password)) { ... } > >else { retry to connect } > > > >but it didn't work. > > > >Does anyone know how to do that ? > > > > > > > > > > If I remember correctly, > the ssh lib dies the script after a login attempt > fails... > so you need to wrap the login attempt in an eval and > then try with a new > password if it fails..... > If you search the list archives I'm pretty certain > its there.... > In fact, if memory serves I asked that very question > about 18 months ago :-> > (I did a debug step through the code and found the > die line) > apologies for the piss poor code :-> > > I think you could just put in a second login attempt > where I have the > write_results sub below. > > Rafe > > use Net::SSH::Perl; > eval { > local $SIG{ALRM} = sub { write_results( > $opt{C}, 2, "Timeout > Failure", 1 ) }; > alarm $TIMEOUT; > $ssh = Net::SSH::Perl->new( $host, > options => [ "Debug 1", > "Protocol 2" ] ); > } > || write_results( $opt{C}, 2, "Connection > Failure", 1 ); > eval { $pwd = $ssh->login( $username, > $password ) }; > if ( !$@ ) { > my $cmd = q( uname); > my ( $stdout, $stderr, $exit ) = > $ssh->cmd($cmd); > > # print "host: $stdout\n"; > chomp($stdout); > if ( $stdout eq "Linux" ) { > > $cmd = "ps -ef |grep -i \"$process\" > |grep -v grep |grep > -v process.pl"; > > } > else { > > $cmd = "/usr/ucb/ps -auxww |grep -i > \"$process\" |grep > -v grep |grep -v process.pl"; > > } > ( $stdout, $stderr, $exit ) = > $ssh->cmd($cmd); > > ___________________________________________________________________________ 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 |
From: Miky J <mi...@ya...> - 2006-02-23 15:50:59
|
Hello, I have a public key id_rsa in my .ssh directory. When I use it it's very slow to connect to the second, thrid,... host. If I rename this id_rsa, then I use passwords everything and it's quick. I have modules IO::Handle Math::BigInt::GMP Any hint ? #!/usr/bin/perl use IO::Handle; use Net::SSH::Perl; use Net::DNS; use Getopt::Std; use strict; my $login='root'; my $password1='pass1'; my $password=$password1; my ($ok,$notok,$total); $total=$ok=$notok=0; my %cmd=(); $cmd{1}="uname -a"; login('host1',%cmd); login('host2',%cmd); sub login { my ($host,%mes_cmd) = @_; my $ssh; $ssh = Net::SSH::Perl->new($host, debug=>1, protocol=>'2', port=>22, PreferredAuthentications=>'publickey,password', identity_files => ["/home/mikydeb/.ssh/id_rsa"]); $ssh->login($login, $password); my $resultat; print "$host"; print "\t"; print "\t$password\n"; for (keys %mes_cmd) { ($resultat) = $ssh->cmd($mes_cmd{$_}); print "$host\t$resultat" if $resultat; } $password=$password1; $ok++; } print "\n---------------------------------------\n"; print "Nb total of machines: $total\n"; print "Nb machines ok: $ok\n"; print "Nb machines unreachable: $notok\n"; print "---------------------------------------\n"; ___________________________________________________________________________ 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 |
From: Miky J <mi...@ya...> - 2006-02-24 13:30:55
|
When i do strace on the program it get stuck there 5822 open("/dev/random", O_RDONLY|O_LARGEFILE) = 4 5822 ioctl(4, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbfbdf468) = -1 EINVAL (Invalid argument) 5822 _llseek(4, 0, [0], SEEK_CUR) = 0 5822 fstat64(4, {st_mode=S_IFCHR|0666, st_rdev=makedev(1, 8), ...}) = 0 5822 fcntl64(4, F_SETFD, FD_CLOEXEC) = 0 5822 read(4, "$\327\364\v\342", 21) = 5 5822 read(4, "\20\235@\1\310W\2668", 16) = 8 5822 read(4, "\2203\356\254\354]\266 ", 8) = 8 5822 close(4) = 0 around the 2nd and 3rd read instruction. --- Miky J <mi...@ya...> a écrit : > Hello, > > I have a public key id_rsa in my .ssh directory. > When I use it it's very slow to connect to the > second, > thrid,... host. > If I rename this id_rsa, then I use passwords > everything and it's quick. > I have modules > IO::Handle > Math::BigInt::GMP > > Any hint ? > > #!/usr/bin/perl > > use IO::Handle; > use Net::SSH::Perl; > use Net::DNS; > use Getopt::Std; > use strict; > > my $login='root'; > my $password1='pass1'; > > my $password=$password1; > my ($ok,$notok,$total); > $total=$ok=$notok=0; > > my %cmd=(); > > $cmd{1}="uname -a"; > login('host1',%cmd); > login('host2',%cmd); > > sub login > { > my ($host,%mes_cmd) = @_; > my $ssh; > > $ssh = Net::SSH::Perl->new($host, debug=>1, > protocol=>'2', port=>22, > PreferredAuthentications=>'publickey,password', > identity_files => ["/home/mikydeb/.ssh/id_rsa"]); > > $ssh->login($login, $password); > my $resultat; > > print "$host"; > > print "\t"; > print "\t$password\n"; > for (keys %mes_cmd) > { > ($resultat) = $ssh->cmd($mes_cmd{$_}); > print "$host\t$resultat" if $resultat; > } > $password=$password1; > $ok++; > } > print "\n---------------------------------------\n"; > print "Nb total of machines: $total\n"; > print "Nb machines ok: $ok\n"; > print "Nb machines unreachable: $notok\n"; > print "---------------------------------------\n"; ___________________________________________________________________________ Nouveau : téléphonez moins cher avec Yahoo! Messenger. Appelez le monde entier à partir de 0,012 /minute ! Téléchargez sur http://fr.messenger.yahoo.com |
From: Bryan B. <br...@bu...> - 2006-02-24 18:04:40
|
> When i do strace on the program it get stuck there > > 5822 open("/dev/random", O_RDONLY|O_LARGEFILE) =3D 4 > 5822 ioctl(4, SNDCTL_TMR_TIMEBASE or TCGETS, > 0xbfbdf468) =3D -1 EINVAL (Invalid argument) > 5822 _llseek(4, 0, [0], SEEK_CUR) =3D 0 > 5822 fstat64(4, {st_mode=3DS_IFCHR|0666, > st_rdev=3Dmakedev(1, 8), ...}) =3D 0 > 5822 fcntl64(4, F_SETFD, FD_CLOEXEC) =3D 0 > 5822 read(4, "$\327\364\v\342", 21) =3D 5 > 5822 read(4, "\20\235@\1\310W\2668", 16) =3D 8 > 5822 read(4, "\2203\356\254\354]\266 ", 8) =3D 8 > 5822 close(4) =3D 0 > > around the 2nd and 3rd read instruction. > > --- Miky J <mi...@ya...> a =E9crit : Looks like you are quickly running out of entropy. Check for patches on your OS that fix this, or do something like this: # mv /dev/random /dev/random.bak # cp /dev/urandom /dev/random Though, expect that your not really getting random numbers after making this change. The better solution would be to fix any os problems. You might check for good entropy by doing this: # cat -uv /dev/random If you see stuff come by pretty fast, then this is not the problem at all. If it hangs after printing a few lines, then you certainly have issues generating enough entropy. Good luck. Bryan http://www.sourceforge.net/projects/rover |
From: Miky J <mi...@ya...> - 2006-02-27 09:14:54
|
These commands seem to have solved the problem > # mv /dev/random /dev/random.bak > # cp /dev/urandom /dev/random Thanx again --- Bryan Bueter <br...@bu...> a écrit : > > When i do strace on the program it get stuck there > > > > 5822 open("/dev/random", O_RDONLY|O_LARGEFILE) = > 4 > > 5822 ioctl(4, SNDCTL_TMR_TIMEBASE or TCGETS, > > 0xbfbdf468) = -1 EINVAL (Invalid argument) > > 5822 _llseek(4, 0, [0], SEEK_CUR) = 0 > > 5822 fstat64(4, {st_mode=S_IFCHR|0666, > > st_rdev=makedev(1, 8), ...}) = 0 > > 5822 fcntl64(4, F_SETFD, FD_CLOEXEC) = 0 > > 5822 read(4, "$\327\364\v\342", 21) = 5 > > 5822 read(4, "\20\235@\1\310W\2668", 16) = 8 > > 5822 read(4, "\2203\356\254\354]\266 ", 8) = 8 > > 5822 close(4) = 0 > > > > around the 2nd and 3rd read instruction. > > > > --- Miky J <mi...@ya...> a écrit : > > Looks like you are quickly running out of entropy. > Check for patches on > your OS that fix this, or do something like this: > > # mv /dev/random /dev/random.bak > # cp /dev/urandom /dev/random > > Though, expect that your not really getting random > numbers after making > this change. The better solution would be to fix > any os problems. You > might check for good entropy by doing this: > > # cat -uv /dev/random > > If you see stuff come by pretty fast, then this is > not the problem at all. > If it hangs after printing a few lines, then you > certainly have issues > generating enough entropy. > > Good luck. > > Bryan > http://www.sourceforge.net/projects/rover > > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a > groundbreaking scripting language > that extends applications into web and mobile media. > Attend the live webcast > and join the prime developer group breaking into > this new coding territory! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642 > _______________________________________________ > Ssh-sftp-perl-users mailing list > Ssh...@li... > https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users > ___________________________________________________________________________ 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 |