Reply to Re: [PHP] Trigger root script?

Your name:

Reply:


Posted by Jake Gardner on 09/26/05 17:42

make sure to set www-data's login script to nologin if you are going to do that.

On 9/26/05, Michael Sims <michaels@crye-leike.com> wrote:
> Jeffrey Sambells wrote:
> > I need a php script to trigger another script to run as root on a
> > machine. Currently, the scripts run as the www-data user, but that
> > means I can't modify any files on the system that aren't owned by
> > www-data or world writable. I somehow need to trigger a php script to
> > run as the root user.
>
> I would use "sudo" for this. It allows non-root users to execute only the
> scripts you specify as root. Take a look at "man sudo" and "man visudo".
> For example, if you wanted your PHP scripts to be able to run the script
> "/usr/bin/foo" as root, you'd put an entry like the following in your
> /etc/sudoers file:
>
> www-data ALL=NOPASSWD: /usr/bin/foo
>
> If you can change the permissions/ownership on the file(s) in question it
> might be better to create a new group to own the files and make them group
> writable, then put the "www-data" user into the new group.
>
> HTH
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

[Back to original 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

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