Re: becoming root user within php

From: Date: Wed, 27 Jul 2005 02:05:14 +0000
Subject: Re: becoming root user within php
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-219389@lists.php.net to get a copy of this message
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


« previous php.general (#219389) next »