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

Don't ask why I'm doing it this way but I have to.

Say I have a user name "bob" and he needs to run a program as "monitor." I want to allow "bob" to sudo into the monitor account and run the process. Obviously I could just give "bob" sudo access to run the app but I'm told it has to run as "monitor." Anyways, how can this be done?

share|improve this question

1 Answer 1

up vote 5 down vote accepted

yup, set your sudoers entry like this:

bob ALL = monitor PASSWD: COMMAND

Bob can then run the COMMAND under sudo and it will run as monitor (you can of course use NOPASSWD: if you want to force a password check).

share|improve this answer
2  
To edit your sudoers file make sure you run visudo. Don't edit the file directly. –  3dinfluence Feb 24 '10 at 22:26
1  
I think that your statement has an error.... PASSWD: does a password check, and NOPASSWD: allows a sudo command to be processed without any password check. –  mdpc Feb 25 '10 at 4:39
    
mdpc - thanks for pointing out my deliberate typo...:) –  Jon Feb 25 '10 at 8:34

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.