whatis user-and-group

Users and Groups

Also known as: UID, GID, /etc/passwd, /etc/group

Linux identifies every account by a numeric user ID (UID) and assigns it to groups (GIDs), which together decide file and process access.

What Are Users and Groups in Linux?

Accounts are listed in /etc/passwd, password hashes in /etc/shadow, and group membership in /etc/group. Each file has one owning user and one owning group, and each process runs as a UID with a set of GIDs.

System accounts with low UIDs run services like www-data or postgres with only the access they need. Adding a person to a group such as docker or wheel grants them that group's privileges after they log in again.

Example

id alice
sudo usermod -aG docker alice