Skip to main content

Creating, Deleting, Updating Accounts

User accounts are managed through system databases stored in /etc/passwd, /etc/shadow, and /etc/group.

Creating a User

Input:

useradd -m alice

This creates user alice with a home directory.

References:

Setting a Password

Input:

passwd alice

Prompts for a new password and stores a hashed value in /etc/shadow.

References:

Modifying User Attributes

Input:

usermod -c "Application User" alice

Updates gecos/comment field for the user.

References:

Deleting a User

Input:

userdel -r alice

Removes user alice and deletes the home directory.

References: