Linux › Module 3 › Lesson 1
Users and Groups
How Linux users, groups, and /etc/passwd control access
Opening
Linux is a multi-user system
Your laptop might feel personal, but Linux was built for many users sharing one machine safely. Every process runs as a user. Every file has an owner. Understanding users and groups is how you read permissions—and spot privilege abuse.
1. Users
A user account has a username, numeric UID, home directory, and default shell. Regular users (like analyst) do daily work. The superuser root (UID 0) can change anything—use it sparingly.
2. Groups
Groups bundle users for shared access. Example: everyone in group developers might write to /srv/projects. A user has one primary group and can belong to additional groups.
3. Useful Commands
whoami
Prints your current username.
id
Shows your UID, groups, and group IDs.
cat /etc/passwd
Lists user accounts (last field is shell). Do not confuse with /etc/shadow (password hashes—root only).
groups
Lists groups your user belongs to.
Defense angle
Attackers who get a foothold often hunt for other users and weak group memberships to pivot. Knowing id and /etc/passwd helps you audit who can access what.
Knowledge Check
Which user has UID 0 and full system control?
Multiple choice
Knowledge Check
What does whoami display?
Multiple choice
Knowledge Check
Why do groups exist on Linux?
Multiple choice