Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

Thanks.

share|improve this question
add comment

1 Answer 1

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
add comment

Your Answer

 
discard

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.