On Tue, May 13, 2008 at 4:32 AM, Jean-Christophe Roux <[EMAIL PROTECTED]> wrote:
> Hello,
>
>  I have a bash script update.sh that contains:
>  rsync -- delete -avz -e ssh ${files} [EMAIL PROTECTED]:/red
>  when I use that script ./update.sh as root, it works like a charm as I set 
> up the private/public key properly.
>  When run from a php script through the apache webserver
>  <?php
>  exec("update.sh");
>  ?>
>  The rsync line is ignored.

    You could use a combination of BASh and Expect shell code here,
but it wouldn't be very secure, because that would automate the root
login.

>  I understand that the php script is called under the apache user, when the 
> private/public key is for my root user. How can I set the the keys so that 
> the apache user can run fully the php script?
>  More generally, how do php users handles the ssh private/public keys when 
> calling rsync?

    Generate keys for `nobody` or `apache` (whatever user as which
Apache is being executed).  Alternatively, install phpSuExec, Suhosin,
or suPHP so that the scripts are run as the user for which they were
called.

-- 
</Daniel P. Brown>
Dedicated Servers - Intel 2.4GHz w/2TB bandwidth/mo. starting at just
$59.99/mo. with no contract!
Dedicated servers, VPS, and hosting from $2.50/mo.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to