In Linux, you can manage user accounts through Graphical User Interfaces (GUI) for simplicity or Command Line Interfaces (CLI) for speed and advanced control.

 

1. Administering Users via GUI
 
GUI tools are best for basic tasks like adding a new person, changing a password, or toggling administrator rights.
  • Settings (Standard GNOME/Ubuntu):
    • Navigate to Settings > Users.
    • You must click the Unlock button and enter your sudo password before making changes.
    • Common actions include clicking Add User, toggling the Administrator switch, or clicking Remove User.

 

2. Administering Users via Command Line
The command line provides precise control and is essential for servers without a desktop interface.

 
TaskCommandDescription
Add Usersudo useradd -m usernameCreates a new user and their home directory (-m).
Set Passwordsudo passwd usernameSets or resets a user’s password.
Modify Usersudo usermod -aG group userAppends (-a) the user to a specific group (-G).
Lock Accountsudo passwd -l usernamePrevents the user from logging in without deleting data.
Delete Usersudo userdel -r usernameRemoves the user and their home directory (-r).