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

Most probably this has already been answered in other threads, but I can't find the exact solution.

I need to call a bash script via a php script which (bash) changes system time. I need to run that bash script as root while not changing apache permissions, i.e. php script called by user 'nobody' and the php script runs the script as root (sudoing is ok as I'm on ubuntu). As that will be called from a browser, I need to get rid of the password prompt

share|improve this question
up vote 2 down vote accepted


$ visudo
nobody ALL = NOPASSWD: /path/to/

Which will allow user "nobody" to run the as any user without password prompt.

share|improve this answer
And don't forget to make the script owned by root, and writable only by root. – Michael Kohne Oct 23 '09 at 11:14
thanks, that worked:) – Tutul Oct 23 '09 at 17:19

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.