Re: becoming root user within php
| From: | Tom Cruickshank | Date: | Wed, 27 Jul 2005 15:11:20 +0000 |
| Subject: | Re: becoming root user within php | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-219424@lists.php.net to get a copy of this message | ||
Hello,
Thanks for all the info guys! I successfully made php use root user to
preform a few commands. I restricted root access to allow only a few
commands which were needed.
I'm doing my best to keep this thing as secure as possible which still
preforming the tasks that need to be done.
Tom
On 7/26/05, Jack Scott <jack@glengroup.com> wrote:
>
> Hello,
> Stop! never give up the root password inside a text file anywhere on
> your machine!
>
> you should keep this script out of the web path and exicute it using
> either the sudo or visudo commands in the shell.
>
> If you are on a UNIX/Linux machine:
> add this to the first line of your script
> #!/usr/bin/php
> (or whatever the path to your php executable is)
>
> then something like this to execute it...
> sudo ./myscript.php
>
> Make sence?
>
> On Tue, 2005-07-26 at 17:28 -0400, 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
>
>