Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I store a website on redhat and using drupal.
There is a button on the site that activates a php script and that php script use exec to activate bash script on the server.
Right now the script is not being run, i guess because of permission reason - the drupal user that runs the bash does not have root access to run the bash script.
How can i add the user as a root and test this ? and then to downgrade it to normal level.
So what i need to know - how to view current users, groups, and status, and changing them.

Is this recommended ? I am not linux expert.


share|improve this question
up vote 1 down vote accepted

You don't need to run your web server (like apache) as root to do this. You can instead allow sudo for the web server user without password. To do so, edit the sudoers file using:

$ sudo visudo

and insert a line like this:

www-data ALL=NOPASSWD: /path/to/your/script

The above line assumes the web server user name is www-data. You need to change it as appropriate.

share|improve this answer
If running on RHEL (or similar), you'll also need to add: Defaults:www-data !requiretty – BMDan Jan 3 '13 at 14:43

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.