Glossary

/etc/group

/etc/group lists the groups on the system and their members. Each line has four colon-separated fields:

groupname:x:GID:member1,member2,member3
sudo:x:27:alice,bob
developers:x:1001:alice,bob,carol

Every user has one primary group (from their /etc/passwd entry) and zero or more supplementary groups (listed here). A user's primary group is the default for files they create; supplementary groups determine what additional resources they can access.

Groups matter because Linux permissions have an explicit "group" class: a file's group determines who, besides the owner, can access it through the group permission bits. Typical groups on a Linux system include sudo or wheel (administrators), adm (log readers), dialout (serial/modem access), video, audio, input, plugdev, docker, and libvirt.

Manage groups with groupadd, groupdel, gpasswd, or usermod -aG group user to add a user to a supplementary group. Like /etc/passwd, /etc/group is world-readable; the corresponding shadow file /etc/gshadow holds group passwords (almost never used in practice).

Related terms: /etc/passwd

Discussed in:

Also defined in: Textbook of Linux

Textbook of Linux — Learn Linux on iPhone — Download on the App Store