For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > March 2005 > perl+php and remote commands









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author perl+php and remote commands
Mariano Cunietti

2005-03-23, 3:56 pm

Hi,
I want to develop a PHP+Perl interface to manage a DNS and a few Mail
servers. I need to interact with other machines on the same network.

Which is the best way to execute commands invoked from the web
interface, pass them to perl and then let them be executed on local and
remote machines? How do PHP and Perl communicate? Via the "system/exec"
function?

Example: from a web panel I want to modify MX records for my DNS zones,
then update transport/mailertable files on remote machines.

Should I put public keys in /root/.ssh/authorized_keys on all machines
and then exec a "ssh root@remotemachine ....."?
Isn't there a more *elegant* solution?
Thanks

Mariano

--
-------------------------
Mariano Cunietti
System Administrator
Enter S.r.l.
Via Stefanardo da Vimercate, 28
20128 - Milano - Italy
Tel. +39 02 25514319
Fax +39 02 25514303
mcunietti@enter.it
www.enter.it - www.enterpoint.it
---------------------------
Gruppo Y2K - www.gruppoy2k.it

Joshua Colson

2005-03-23, 3:56 pm

On Wed, 2005-03-23 at 16:48 +0100, Mariano Cunietti wrote:

....snip...

> Should I put public keys in /root/.ssh/authorized_keys on all machines
> and then exec a "ssh root@remotemachine ....."?


No. That is basically the same a putting the password in a file on disk.

> Isn't there a more *elegant* solution?


Yes. It is called SOAP.

> Thanks
>
> Mariano
>
> --
> -------------------------
> Mariano Cunietti
> System Administrator
> Enter S.r.l.
> Via Stefanardo da Vimercate, 28
> 20128 - Milano - Italy
> Tel. +39 02 25514319
> Fax +39 02 25514303
> mcunietti@enter.it
> www.enter.it - www.enterpoint.it
> ---------------------------
> Gruppo Y2K - www.gruppoy2k.it
>
>

--
Joshua Colson <jcolson@giant.com>
Sr. Systems Administrator
Giant Industries, Inc
P: (480) 585-8714
F: (480) 502-6641

JupiterHost.Net

2005-03-23, 3:56 pm



Mariano Cunietti wrote:
> Hi,
> I want to develop a PHP+Perl interface to manage a DNS and a few Mail
> servers. I need to interact with other machines on the same network.
>
> Which is the best way to execute commands invoked from the web
> interface, pass them to perl and then let them be executed on local and
> remote machines? How do PHP and Perl communicate? Via the "system/exec"
> function?
>
> Example: from a web panel I want to modify MX records for my DNS zones,
> then update transport/mailertable files on remote machines.
>
> Should I put public keys in /root/.ssh/authorized_keys on all machines
> and then exec a "ssh root@remotemachine ....."?
> Isn't there a more *elegant* solution?


Yes, I'd not mix the languages. Just use Perl for all of it, that will
instantly make it 100% easier to develop.

The modules
Net::SSH or Expect may help. Depending on what you need to ssh in and
run there may be other solutions.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com