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 user account.

userdel user

Delete the user account.

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 ...

Get LPI Linux Certification in a Nutshell, 2nd Edition now with O’Reilly online learning.

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