Lesson 4.1: Working with users and groups
Why Linux has many users (most of them not people), UID and GID, what each field of /etc/passwd and /etc/group means, groups as shared keys, and creating a user and adding them to a group.
17 min
You will learn to
- Explain users, groups, UID and GID
- Read every field of /etc/passwd and /etc/group
- Tell human accounts from system (service) accounts
- Create a user with useradd -m and add them to a group with usermod -aG
Key terms
- User (account)
- An identity the system knows, with its own files, processes and rights. It can be a person or a service.
- UID
- The user's number. The kernel works with numbers, not names: 0 is root, 1-999 are system accounts, 1000 and up are people (on Ubuntu).
- root
- The administrator account, UID 0. The kernel skips permission checks for it: it may read, change and delete anything.
- System (service) account
- An account a program runs as, so that a break-in into that program only gets that account's limited rights. It can't log in.
- Group and GID
- A named set of users that share access, with its own number (GID). Each user has one primary group and any number of supplementary groups.
← Searching the filesystem: find and locate · All lessons · File and directory permissions →