in reply to Help with Net::SSH

Might I suggest that you instead use Net::SSH::Perl (self-promotion, yes), which provides a Perl client interface to SSH?

It would make this much easier:

use Net::SSH::Perl; my $ssh = Net::SSH::Perl->new($host); $ssh->login($user); my($out, $err, $exit) = $ssh->cmd($cmd);
$out now holds the STDOUT of the command $cmd on the remote machine, so it looks just like it would if you had logged into the remote machine and run the command. So you can do a pattern match on it, for example, to see if 'fwd' is running.

Replies are listed 'Best First'.
Re: Re: Help with Net::SSH
by dru145 (Friar) on Jun 01, 2001 at 00:27 UTC

    I originally tried using Net::SSH::Perl, but I found it difficult to install because of all the prereqs for Crypt::RSA. I'll give it another try because it sounds like it will be easier.

    Thanks,

    Dru

      Crypt::RSA is completely optional, don't worry about it if you don't have it. It's only used for RSA support in SSH-2 (SSH-1 RSA is built in to Net::SSH::Perl), and odds are you're probably not using RSA in SSH-2.

      Also, the list of prereqs depends completely on what protocol you'll be using. If you're using SSH-1 only, your list of prereqs is pretty short, and should be fairly simple to install.

      If you're using SSH-2, the list of prereqs is longer, but it's still pretty easy, at least on a *nix system. Windows is a little trickier. Which are you running on?

      If you're having trouble using Net::SSH::Perl, feel free to email me.