I have several users, which are all part of group X.

And I want to be able to give user Y to sudo to members of group X.

Obviously I don't want to edit sudoers everytime I add a user to group X, is there an elegant way to solve this? sudoers doesn't seem to have syntax for this.


Wherever you can write a user name (User list or Runas list), you can write % followed by a group name instead.

Y ALL = (%X) ALL

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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