Skip to content
BENIBIX Learn

User Group (Linux)

Infrastructure⌨️ Linux & the Command LineUsers and Permissions

Also known as Linux Group, Unix Group, groups Command

A named set of Linux users that share the same rights.

Think of it like

Think of it like a club badge. Everyone with the badge may use the club room.

Example

Lucy adds Jack to the docker group. Now he can run Docker without typing sudo each time.

Why it matters

Groups let a team share files and tools without handing anyone the root key.

Definition

A user group is a named set of users on a Linux system. Rights can be given to a whole group at once, not one person at a time. Each file has one owner and one group. A user can be in many groups. On Ubuntu, users in the sudo group may use sudo.

Example code

console
$ sudo usermod -aG docker jack
$ groups jack
jack : jack docker
Jack joins the docker group. The second line lists every group he is in.
The middle three letters are the group's rights. Everyone in the group gets them.

Common mistake

Expecting a new group to work at once. The user must log out and back in first.

Key takeaways

  1. 1
    A named set. Many users, one name.
  2. 2
    Rights by group. Give access once, to all.
  3. 3
    Log in again. New groups apply at the next login.

Learn it properly