LPI Linux Certification in a Nutshell, 2nd Edition
by Steven Pritchard, Bruno Gomes Pessanha, Nicolai Langfeldt, James Stanger, Jeff Dean
Administrative Tasks (Topic 1.111)
Objective 1: Manage Users and Group Accounts and Related System Files
passwd and group
User account information is stored in /etc/passwd.
Each line in /etc/passwd contains a username, password, UID, GID, user's name, home directory, and default shell.
Group information is stored in /etc/group.
Each line in /etc/group contains a group name, group password, GID, and group member list.
passwd and group are world-readable.
Shadow files
To prevent users from obtaining encrypted passwords from passwd and group, shadow files are implemented.
Encrypted passwords are moved to a new file, which is readable only by root.
The shadow file for /etc/passwd is /etc/shadow.
The shadow file for /etc/group is /etc/gshadow.
User and group management commands
The following commands are commonly used for manual user and group management :
-
useradd
user Create the account
user.-
usermod
user Modify the
useraccount.-
userdel
user Delete the
useraccount.-
groupadd
group Add
group.-
groupmod
group Modify the parameters of
group.-
groupdel
group Delete
group.-
passwd
username Interactively set the password for
username.-
gpasswd
groupname Interactively set the password for
groupname.- pwconv
Convert a standard password file to a shadow configuration.
- pwunconv
Revert from a shadow password configuration.
- grpconv
Convert a standard group file to a shadow configuration.
- grpunconv
Revert from a shadow group configuration.
- chage user
Modify password aging and expiration settings for
user.
Objective ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access