83

I noticed that two groups are granted similar-looking permissions in /etc/sudoers:

# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL

# Allow members of group sudo to execute any command
%sudo   ALL=(ALL:ALL) ALL

My user account with "Administer the system" privileges is in the admin group, and there don't appear to be any users in the sudo group. What are these two groups for?

3 Answers 3

69

Ubuntu 12.04 LTS and later

Administrators are added to the sudo group, but the admin group is supported for backward compatibility. From the release notes:

Up until Ubuntu 11.10, administrator access using the sudo tool was granted via the admin Unix group. In Ubuntu 12.04, administrator access will be granted via the sudo group. This makes Ubuntu more consistent with the upstream implementation and Debian. For compatibility purposes, the admin group will continue to provide sudo/administrator access in 12.04.

It is not created when you do a fresh install, though it is still present if you upgraded from previous distributions. Either way, the admin group appears in the /etc/sudoers file.

See implementation details and the official documentation.

2
  • 1
    Cool. Thanks! Could you please add an explanation about the difference between ALL=(ALL) and ALL=(ALL:ALL)?
    – wedi
    Feb 14, 2018 at 21:38
  • Never mind, just saw the answer in Aleksandr's answer below...
    – wedi
    Feb 14, 2018 at 21:39
26

Ubuntu 11.10 and earlier

By default the sudo group is not used in Ubuntu:

  • the user created during installation belongs to admin group, not sudo;
  • no guide or manual I ever read advices to use the sudo group;
  • no one feels the need to use the sudo group, because the admin group can do all one needs.

Conversely, on Debian the group enabled in /etc/sudoers is the sudo group, and there is no admin group. But the user created during installation is not put in that group, because Debian has the root account enabled. You should do it explicitly, if you want to.

Also, Fedora is similar to Debian, having root enabled and no default privileges for the user create during installation. But the administrative group configured in /etc/sudoers is the more traditional group wheel.

In conclusion, I think there is no use for sudo group in Ubuntu, simply it is a Debian heritage.

2
  • On my Ubuntu system, no users are member of sudo: grep '^sudo:' /etc/group (just installed). Not sure about Debian, I've just added my own name to the /etc/sudoers file.
    – Lekensteyn
    May 17, 2011 at 15:59
  • 1
    @Lekensteyn: as I said, on Debian you should explicitly add a user to the sudo group to gain administrative privileges: su -c "gpasswd -a $USER sudo", no need to modify /etc/sudoers. Or you can stand with the Debian way of using directly the root account.
    – enzotib
    May 17, 2011 at 16:03
25

No security difference.

Both have 100% unrestricted access to anything provided by the OS.

The difference in your /etc/sudoers is (ALL) vs (ALL:ALL). The first one means you can run commands as any user. The second - you can run command as any user and as any group.

The way shown in your /etc/sudoers both groups will need to enter their own password to execute commands as root.

Both can a root shell like this:

sudo su
2
  • 13
    What can't I do without the "as any group" bit? Aug 5, 2015 at 4:03
  • 5
    If a program is specifically allowed to be executed only by a specific group, then a user with (ALL), that does not belong to that group can't execute that command. Just like here, users that are in the group admin and not in the webuser group, can't execute firefox.
    – Stam Kaly
    Jan 27, 2019 at 10:31

You must log in to answer this question.

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