Re: Net::SSH::Perl extremely slow?



"Yon" <yonyohnson@xxxxxxxxxxx> writes:

> I have a simple perl script that connects to a remote machine and
> executes a command. Net::SSH::Perl seems etremely slow, but I've tried
> it on 2 machines (Suse 9.3 and Suse 9.2). They aren't the fastest
> machine, but both are over 2GHz so I thought I'd be ok. Both have 1 Gig
> of RAM. I've tested over the network and against the loopback
> interface.
>
> here's the code. It ends up executing completely, it just takes 20-30
> seconds.
>
> Does this seem unusually long to anyone?
>
> <trim>
> $ssh = Net::SSH::Perl->new("192.168.1.69",debug=>1,protocol=>2,options
> =>[ "UserKnownHostsFile /var/lib/wwwrun/.ssh/ssh_known_hosts",
> "IdentityFile /var/lib/wwwrun/.ssh/id_dsa" ] );
> $ssh->login("webrun");
> #
> ($out, $err, $exit)=print $ssh->cmd("ls -la");
> <trim>
>
> tia, y

Try to supply passwd and port like this:
$ssh = Net::SSH::Perl->new("192.168.1.69", port=>22);
$ssh -> login('webrun','passwd');

My time is around 5 seconds.

HTH, Radek
.



Relevant Pages

  • Re: Sending commands to new shell in Perl
    ... >I am trying to do the following in a Perl script: ... > ssh to a remote machine ... switch to tcsh ...
    (comp.lang.perl.misc)
  • Re: Sending commands to new shell in Perl
    ... > I am trying to do the following in a Perl script: ... > ssh to a remote machine ... switch to tcsh ...
    (comp.lang.perl.misc)
  • Sending commands to new shell in Perl
    ... I am trying to do the following in a Perl script: ... ssh to a remote machine ... once on the machine, switch to tcsh ... once in tcsh, execute commands ...
    (comp.lang.perl.misc)
  • rsh & perl -Directory creation not possible
    ... I have a perl script which creates a directory in the local machine. ... But, if I call this script from the remote machine using rsh, the ...
    (comp.lang.perl.misc)
  • Re: Remote Execution Through FTP
    ... > I need to send some file from my local machine to a remote machine ... > generation mechanism in SSH. ... then you can script this quite easily using public key's to authenticate. ... Make sure the permissions on the .ssh directory and all the files in it are ...
    (comp.unix.admin)