in reply to SSH help??

I'm sure that you could try to do it without installing a module, but the question is why would you? Someone else has already figured out all of the hard stuff you'd need to figure out in order to get ssh to work from within your program - leverage their work. You'll get your job done quicker and you won't be reinventing wheels.

From the Net::SSH::Perl docs (Ben said this better than I did):

One advantage to using Net::SSH::Perl over wrapper-style implementations of ssh clients is that it saves on process overhead: you no longer need to fork and execute a separate process in order to connect to an sshd. Depending on the amount of time and memory needed to fork a process, this win can be quite substantial; particularly if you're running in a persistent Perl environment (mod_perl, for example), where forking a new process is a drain on process and memory resources.
It also simplifies the process of using password-based authentications; when writing a wrapper around ssh you probably need to use Expect to control the ssh client and give it your password. Net::SSH::Perl has built-in support for the authentication protocols, so there's no longer any hassle of communicating with any external processes.

Replies are listed 'Best First'.
Re: Re: SSH help??
by needhelp (Initiate) on Jun 18, 2003 at 17:22 UTC
    That is true and it would save me alot of time. I guess the next question is what module should I use. I have heard of Net::SSH and Net::SSH::Perl. Is there any suggestions or comments? Which one has less prereqs? Any advantages or disadvantages of either? Thanks, John

      Quite simply, Net::SSH::Perl rocks. I use it in a production environment with great success. There are a boatload of prereqs but don't let that put you off and once installed you'll be glad you persevered.

      -- vek --