This guide covers users and groups in Ubuntu step by step, with every setting in the order you will use it. User and group management is one of the first Linux administration skills to master. On Ubuntu, every file, process and login belongs to a user, and groups control what several users can share. This guide covers the essential commands for day-to-day user administration on Ubuntu Server and Desktop.

dns LAB TOPOLOGY & PREREQUISITES
# example values used while writing and testing this guide
LAB VM
UBUNTU BUILD
VALIDATION
01constructionUsers and groups in Ubuntu: Create a New User
The friendliest way to create a user is adduser, which asks for a password and details interactively:
sudo adduser sarah
This creates the user, a matching group, a home directory (/home/sarah) and prompts you to set the account’s password. The lower-level command useradd works too, but it does not set up the home directory or password automatically.
02downloadSet or Change a Password
To change a password at any time, use passwd:
sudo passwd sarah
Without sudo, passwd changes only your own password. Users should be prompted to change weak or known passwords. In short, users and groups in Ubuntu works best when you follow the order above and verify each step.
03usbCreate and Manage Groups
Groups let many users share the same permissions. Create a group with groupadd:
sudo groupadd developers
Add a user to a group with usermod -aG (the -a flag appends, keeping existing memberships):
sudo usermod -aG developers sarah
To see a user’s groups, run groups sarah. To list all groups on the system, inspect /etc/group.
04terminalGrant Administrator Rights with the sudo Group
On Ubuntu, members of the sudo group can run commands as root. To make a user an administrator, add them to that group:
sudo usermod -aG sudo sarah
Sign out and back in for group changes to take effect.
05settings_ethernetModify and Delete Users
- Change a username:
sudo usermod -l newname oldname - Lock an account:
sudo usermod -L sarah - Delete a user and their home directory:
sudo deluser --remove-home sarah - Delete a group:
sudo groupdel developers
06languageThe Files Behind the Commands
Everything above edits plain text files: user accounts live in /etc/passwd, password hashes in the shadow file and groups in /etc/group. Reading these files is a great way to understand how Linux authentication really works. In short, users and groups in Ubuntu works best when you follow the order above and verify each step.
Watch: How to Manage Users and Groups in Ubuntu
Because some steps are easier to copy from video, this companion walkthrough mirrors the lab above. Also, the chapter pills follow the same order as the steps.
How to Install and Configure DNS Server in Ubuntu
Finish this lab, then continue down the track. Each guide builds on the one before it.