why is perl::ssh so slow ?

  • Thread starter Reinhard Glauber
  • Start date
R

Reinhard Glauber

if I use putty to connect to a ssh server it takes just 1 or 2 seconds

but with the perl::ssh module it takes about 10 seconds, and the "dir" command is not executed (its openssh on a windows machine)

thanks

use Net::SSH::perl;

my $host = '192.168.3.235';
my $user = 'susi';
my $cmd = 'dir';
my $password = 'helpme';

my $ssh = Net::SSH::perl->new($host, port=>22);

$ssh->login($user, $password);
my($out, $err) = $ssh->cmd($cmd);
print $out;
 
S

Samwyse

What is this 'perl::ssh' of which you speak? I've never heard of it,
and CPAN doesn't seem to know of it, either.
 
B

Brian Wakem

Reinhard said:
ok, here ist the debug-output .. if it helps ;-)

nobody: Reading configuration data /home/Explorer/.ssh/config
nobody: Reading configuration data /etc/ssh_config
nobody: Connecting to 192.168.3.235, port 22.
nobody: Remote protocol version 2.0, remote software version OpenSSH_3.8.1p1
nobody: Net::SSH::perl Version 1.29, protocol version 2.0.
nobody: No compat match: OpenSSH_3.8.1p1.
nobody: Connection established.
nobody: Sent key-exchange init (KEXINIT), wait response.
nobody: Algorithms, c->s: 3des-cbc hmac-sha1 none
nobody: Algorithms, s->c: 3des-cbc hmac-sha1 none
nobody: Entering Diffie-Hellman Group 1 key exchange.
nobody: Sent DH public key, waiting for reply.
nobody: Received host key, type 'ssh-dss'.
nobody: Host '192.168.3.235' is known and matches the host key.
nobody: Computing shared secret key.
nobody: Verifying server signature.
nobody: Waiting for NEWKEYS message.
nobody: Enabling incoming encryption/MAC/compression.
nobody: Send NEWKEYS, enable outgoing encryption/MAC/compression.
nobody: Sending request for user-authentication service.
nobody: Service accepted: ssh-userauth.
nobody: Trying empty user-authentication request.


This could be the problem. You will get a ~3 seconds delay after a
failed login attempt on most unix/linux systems.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top