From: EZP on
Hi all,
I'm running the script below in windows command line and the script is
stuck.
(I need to run the unix task from the windows command line.)


#!/usr/bin/perl
use strict; use warnings;
use Net::SSH qw (ssh issh sshopen2 sshopen3);


print Net::SSH::ssh_cmd( {
host => 'host.name',
command => 'ls',
} );


please help, thanks in advance.
EZP

p.s. I downloaded the SSH.pm from CPAN

From: usenet on
EZP wrote:
> I'm running the script below in windows command line and the script is stuck.
> (I need to run the unix task from the windows command line.)

By 'stuck' do you mean it hangs forever? Have you let it go for a long
time (5-10 minutes) and see if it eventually times-out?

Do you have OpenSSH installed on your machine?

Can you connect to the UNIX host directly from ssh in a terminal
window? If you can't do it from a terminal, you can't do it in Perl
(and the problem, in that case, has nothing to do with Perl).

Is there a firewall between your Windows and UNIX boxes that is
blocking port 22 (the standard SSH port)?

Does your Windows userid exactly match your UNIX userid? If not, you
need to tell the UNIX box which userid you are trying to connect with.

Have you created a PKI key-pair and put the public key in the
authorized_keys file of the $HOME/.ssh directory of the remote user on
the UNIX machine?

> p.s. I downloaded the SSH.pm from CPAN

Downloading is not the same as installing. You actually installed SSH
from a CPAN build onto a Windows machine? You have a development
environment on your Windows box??? That's very unusual (most
Windows-types get their modules from ActiveState).

--
David Filmer (http://DavidFilmer.com)

From: usenet on
EZP wrote:
> host => 'host.name',

Oh, and you did actually replace that with a valid hostname or IP
address, right?

--
David Filmer (http://DavidFilmer.com)

From: Stephane Habett Roux on
In message <1160631804.192613.106290(a)m73g2000cwd.googlegroups.com>
"EZP" <peretz.eyal(a)gmail.com> wrote:

> #!/usr/bin/perl
> use strict; use warnings;
> use Net::SSH qw (ssh issh sshopen2 sshopen3);
>
>
> print Net::SSH::ssh_cmd( {
> host => 'host.name',
> command => 'ls',
> } );

I don't know this module but i guess there's at least a username
missing.

--
Stephane Habett Roux
http://habett.org - http://habett.com
Crashed occident, we need another wall
From: usenet on
Stephane Habett Roux wrote:
> I don't know this module but i guess there's at least a username
> missing.

By default, the module uses the username of the client user. You only
need to specify the username if it is different on the target system.

--
David Filmer (http://DavidFilmer.com)