Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question

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
share|improve this answer

Your Answer


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.