Re: Help with writing SSH script without Net::SSH::Perl module On 6/14/07, Chas Owens  wrote:
> On 6/14/07, Clif Hudson  wrote:
> > Could someone point me to a book or online reference that shows me how to
> > create a SSH script from scratch.  I know I could use the Net::SSH::Perl
> > module, but I don't have access to the external resources needed to download
> > the module because of the network restrictions.
> >
> > Sincerely,
> > Clif Hudson
> >
> > clifrunsalot@yahoo.com
>
> There is always a way to download a module.  You have ssh access to
> the box (otherwise you wouldn't want the module), so download the
> module to a local machine and scp it over.  If the reason isn't really
> network restrictions, but rather sysadmins who don't want new Perl
> modules installed on "their" box, you can always install the module in
> the directory of the user who is going to run the code.  If this still
> freaks out your sysadmins, well, you are stuck with puppet stringing
> the ssh command through IPC::Open3* (which is part of core Perl, so
> they can't complain).
>
> * http://search.cpan.org/~nwclark/perl-5.8.8/lib/IPC/Open3.pm
>

My last statement about puppet stringing being your only option is
true if you need to do something complex that needs to respond ssh's
output.  If all you need to do is run a command on a remote host then

my @host_files_in_tmp = qx(ssh user@host ls /tmp);

Will work just fine.

-- 
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/


