CertGrid CertGrid
Hands-on Lab·Linux Foundation Certified System Administrator

Users, accounts and what useradd does

Creating an account is one command; knowing what it did is the examinable part. This guide reads the seven fields of /etc/passwd, shows where a new home directory comes from, contrasts a login account with a service account, and demonstrates what userdel leaves behind - which is more than people expect.

Users and Groups Guide 18 of 38 Beginner

shadow-utils on both families. The defaults differ slightly - UID_MIN is 1000 on both modern families, and USERGROUPS_ENAB yes giving each user a private group is the norm on both.

Both families. The RHEL transcript came first, during an outage that took both Ubuntu hosts offline; the Ubuntu half was captured afterwards and is the last step of each page, because Ubuntu is what LFCS is most likely to sit you in front of.
Server NameIP AddressOSRolesCPURAMHDD
LFCS-A01192.168.0.70Ubuntu 26.04 LTSPrimary host - most guides run only here2 Core4 GB50 GB
LFCS-C01192.168.0.72AlmaLinux 10.2The other distribution - dnf, firewalld and NetworkManager2 Core4 GB50 GB

This guide includes

Use this because creating an account is one command and knowing what it did is the examinable part. This matters because nologin does not block sudo -u - the account you thought was unusable is still reachable.

Before you start

  1. What useradd actually does

  2. The seven fields, and the file you cannot read

  3. A service account is a different shape

  4. And nologin does not block sudo -u

  5. Changing an account

  6. And what removing one leaves behind

  7. The same commands on Ubuntu, and where they differ

Official sources