Below is what I know:
I have to add this below line in sudoers
file to give rights to the user for particular task.
user_name ALL=NOPASSWD: /usr/bin/apt-get install
In this case I want to give access to this user to restart 2 services (i.e. Apache
and MySQL
) with all install rights.
Using the above line, I have given him all install rights, now do I have to add same line two more times to give the rights for services? Or can I just add those commands in the same line, separated by comma or something?
I have solved the issue by creating a new group for limited admin rights... name of that group is
LimitedAdmins
after that I updated thesudoers
file as below.The line I appended is:
This is the complete
/etc/sudoers
file:It works perfectly fine in case if your system is domain or not.
Looks like comma is what you need.
Source
FWIW, I was wondering the same thing as the OP, and it looks like you can as well just duplicate the lines, e.g.
What I ended up doing was (Similar to what you are looking for):
Inside:
/etc/sudoers.d/666-prtg
(666, because... well... prtg IS a windows based monitoring tool you know)