Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 have to execute a shell script as another user, but without be prompted for password.

I've edited the etc/sudoers file with visudo, adding the following line.

_www  localhost=(otheruser) NOPASSWD:/patho/to/my/

If I understand how sudo works, this means that user _www is allowed to execute like user 'otheruser', without be prompted for password, only from localhost.

is that correct?

the system continue to prompt for the password...

share|improve this question

migrated from Jan 11 '14 at 0:31

This question came from our site for professional and enthusiast programmers.

No, it means that the _www user can do /patho/to/my/, which is not enough. You should add /bin/sh to make it an executable command. All together, /bin/sh /patho/to/my/ – fedorqui Jan 10 '14 at 14:22
Thank you, but it still prompt me for the password – user3181041 Jan 10 '14 at 14:25
This question is off-topic here. If the question was about the script file itself, it would be appropriate, but you're asking about system configuration instead. Your question would be more suitable for Ask Ubuntu or Super User instead. – Ken White Jan 10 '14 at 14:34
Ok, I will ask to the right place. Thank you. – user3181041 Jan 10 '14 at 16:29

Your Answer


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

Browse other questions tagged or ask your own question.