You are here: Re: [PHP] becoming root user within php « PHP « IT news, forums, messages
Re: [PHP] becoming root user within php

Posted by Vidyut Luther on 10/01/14 11:22

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
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация