I am trying to figure this out, but have not found a proper answer to this yet:

Is it possible to add a user to /etc/sudoers only with the rights to use sudo -u for specific users?

link|improve this question

1  
it's not clear to me: do you mean to limit the target users? E.g. permit say jsmith to run sudo -u jbloggs foo and sudo -u jdoe foo but not sudo -u jchin foo – Norky Jul 29 '11 at 9:57
feedback

2 Answers

up vote 1 down vote accepted

Yes you can specify the users in the sudoers file

To let youruser run any command as the user specificuser do this:

youruser      ALL = (specificuser)    ALL
link|improve this answer
feedback

From the man sudoers page:

A Runas_Spec sets the default for the commands that follow it. What this means is that for the entry:

    dgb    boulder = (operator) /bin/ls, /bin/kill, /usr/bin/lprm

The user dgb may run /bin/ls, /bin/kill, and /usr/bin/lprm -- but only as operator. E.g.,

    $ sudo -u operator /bin/ls.

I'm running sudo-1.7.4p5-4.fc15.x86_64

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.