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 Learn more about Users and Groups
- Linux Users, Groups, and Ownership Explained Linux is a multi-user operating system built around a clear identity model. Understanding users, groups, UIDs, GIDs, sudo, and the root account is essential for administering any Linux system.
- Managing User Accounts on Linux How to create, modify, and remove user accounts on Linux with useradd, usermod, userdel, and passwd, plus what actually lives inside /etc/passwd and /etc/shadow.
- The groups Command Explained The groups command shows which groups a user belongs to, the basis for a large part of Linux's access control model. This guide covers primary vs supplementary groups, /etc/group, and managing group membership.
- chown Command Explained chown changes which user and group own a file or directory. This guide covers the user:group syntax, recursive ownership changes, and common patterns for web servers and shared directories.
Related tools
- useradd / usermod Builder Build user creation and modification commands without accidentally wiping group membership.
- chmod / chown Builder Work out permission octals and ownership commands with a visual rwx matrix.