Re: becoming root user within php

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Tom,
First of all due to the "risks" involved in doing something like this.. are you sure you need to do this as root ? Secondly, are you sure this script will not be accessible via an apache server ? (i.e this is not inside your document root?)

Your best bet is to use sudo (man sudo, man visudo).

I would suggest narrowing down the list of commands you want to run, and only allowing those commands in your sudoers line.

The man pages have lots of examples.



On Jul 26, 2005, at 5:28 PM, Tom Cruickshank wrote:

Hello,
I'm in the process of executing system commands using php. The only problem is that I am not entirely sure how to execute these system commands using
root user.
(I need root access to do a few things through php). Whenever I use the exec command it uses the www user. Would anyone know? Thanks for any assistance!

Tom


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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux