0

I am looking for a solution to a use case where a group is granted sudoer privileges. However, only one specific user or member within that group should have sudoer permission privileges, while the remaining members of the group should not have permission to access sudoer privileges.

In summary:

A group has been granted sudoer privileges. Only one member of the group should have sudoer privileges. The rest of the group's members should not have sudoer privileges.

1 Answer 1

3

Remove the privilege from the group, and add it to the single user that needs it.

Alternatively, create a new group that can encompass the users that should have sudo privileges, give that group sudo privilege, and add the user that needs sudo privileges to that group. Then in the future if other users need to have the same sudo privileges they can just be added to the group.

2
  • Thanks for your reply. So we can not give limited set of privileges of group to a single member, extra privileges to a single member that are not granted to group and exclude a group members from group privileges. Are these task can be achieved by manipulating ALL =(ALL:ALL) ALL in /etc/sudoer file? Oct 12, 2023 at 6:56
  • No, when you grant privileges to a group, the entire group gets those privileges. But you can grant certain privileges to a group and also grant other certain privileges to a user (even if they are in the group). This task could be achieved by adding lines to /etc/sudoers or by creating files under /etc/sudoers.d. It's personal preference, but sometimes having separate files under /etc/sudoers.d can make it easier to manage. I recommend taking a deeper look at the sudoers man page to see the different ways that those lines can be constructed to best suit your needs.
    – Natolio
    Oct 12, 2023 at 12:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .