1
vote
3answers
421 views

Security implications of adding www-data to /etc/sudoers to run php-cgi as a different user

What I really want to do is allow the 'www-data' user to have the ability to launch php-cgi as another user. I just want to make sure that I fully understand the security implications. The server ...
1
vote
3answers
766 views

Apache sudoers access

I am making a system call from php which is `sudo /usr/bin/perl -pi -e 's/foo/bar/g' /tmp/newxml.xml`; which works fine in php cli. But would not work in php via browser, because apache does not ...
1
vote
3answers
4k views

PHP script needs permission to run a sudo command with shell_exec()

I have a PHP script which contains a shell_exec() and the command it executes normally requires sudo. I've edited the sudoers with visudo to contain the following: www-data ALL = NOPASSWD: ...
1
vote
1answer
1k views

How to edit /etc/sudoers to allow a user to run specific shell scripts?

I have a few scripts in a directory which I need www-data to run (from PHP) with root permissions. It seems like CMND_ALIAS= /path/to/script, /bin/sh www-data ALL=(ALL) NOPASSWD: CMND_ALIAS gives ...
1
vote
1answer
252 views

Granting php sudo acsess

I am trying to grant php sudo access (for automated share mounting). I was sucess full at granting php sudo access on one of my systems by adding daemond to the list of sudo's via su --login -c ...
2
votes
2answers
938 views

Problems restarting apache via PHP (even with sudo)

As part of the signup process on our site, VirtualHost directives get created an added to a config file via PHP, after each VirtualHost is created apache is restarted gracefully so that the new site ...
3
votes
4answers
7k views

Allow Apache to run a command as a different user

I have a script that executes several commands in a user's home directory. The files are owned by the user and Apache (the www-data group) only has read privileges to them. The script needs to be ...