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 need to invoke sudo from a PHP script (web-triggered) so as to run a command as another user.
However, I get the message "sudo: sorry, you must have a tty to run sudo".

Would there be any security problem on giving the user nobody a tty??

Would you recommend a different approach to do what I need (run a shell script as a different user)?

share|improve this question
up vote 1 down vote accepted

Hmm sudo requires tty?


Disable an option for a user (or the default setting):

share|improve this answer
Perfect. Thanks. – GetFree Dec 14 '09 at 23:32

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.