greatshots has asked for the wisdom of the Perl Monks concerning the following question:

monks,

I was trying to access a unix machine which is recently updated with SSH connection. my perl code is

use Net::SSH qw(sshopen2); my $user = "metrica"; my $host = "1em0n5"; my $cmd = "ls"; sshopen2("$user\@155.226.201.96", *READER, *WRITER, "$cmd") || die "ss +h: $!";
and I am getting the error as follows
C:\Documents and Settings\guest\Desktop>'ssh' is not recognized as an +internal or external command, operable program or batch file.
Could any one help me to solve this. what is the cause of this issue.

Replies are listed 'Best First'.
Re: Remote machine access issue using Net::SSH
by moritz (Cardinal) on Nov 13, 2007 at 07:24 UTC
    It seems that Net::SSH uses the binary program called ssh, which is not installed on your machine.

    The obvious fix is to install it.

Re: Remote machine access issue using Net::SSH
by cmv (Chaplain) on Nov 13, 2007 at 14:01 UTC
    If you want to connect to a far end machine via ssh, but don't want to install the ssh binaries on your local machine, you can install Net::SSH::Perl for an all-Perl implementation of the SSH protocols. Note that this installation is not trivial as it requires a large number of other modules.
Re: Remote machine access issue using Net::SSH
by RaduH (Scribe) on Nov 13, 2007 at 15:43 UTC
    I strongly recommend you use Net::SSH2. Just make sure you get its latest version (0.18 or later) and also make sure you have libssh2 version 0.18 or later (important bug fixes went into both 0.18)