Chapter 5. Managing Users and Groups

Linux has two types of users: human users and system users. Each user has a unique identity (UID), and at least one group identification (GID). All users have one primary group and may be members of multiple groups.

Each human user owns a home directory for their personal files. User home directories belong in /home and are named for the owner, like our example user Duchess, who owns /home/duchess. Users may belong to multiple groups, and the additional group memberships are called supplemental groups. Users in a group have all the privileges of that group. (To learn all about privileges, see Chapter 6.) Privileges control access to files and commands, and are fundamental to system security.

System users represent system services and processes. System users need user accounts for controlling their privileges and do not have logins or directories in /home.

Human users are divided into two categories: the root user, or the superuser, is all-powerful and can do anything on the system. All other users are called normal or unprivileged users. Normal users are given just enough privileges to manage their own files and run commands that allow normal users to use them. Normal users can be given limited or complete root powers, which you will learn about in the recipes about su and sudo.

You can see all the users on your system in /etc/passwd, and all the groups in /etc/group.

Centralized User Management

/etc/passwd and /etc/group are inherited from ...

Get Linux Cookbook, 2nd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.