Previous: Command History | Next: The Filesystem
Linux has two categories of users: root (superuser) and normal users. Knowing the difference is essential for permissions, security, and daily operations.
| User Type | Home Directory | UID | Privileges | Common Groups |
|---|---|---|---|---|
| root | /root |
0 |
Full, unrestricted | root, wheel, sudo |
| Normal user | /home/<username> |
≥ 1000 | Limited to owned files | users, sudo (if granted) |
Root is powerful but risky — a single mistake can break the system. Operate as a normal user for daily tasks and only escalate when necessary.
The root account has unrestricted access to all commands, files, and settings. It can modify system configuration, install or remove software, and manage other users.
- Username:
root - Home:
/root - UID:
0
Different distributions use different group names for granting sudo access:
| Group | Used on |
|---|---|
sudo |
Ubuntu, Debian |
wheel |
Fedora, CentOS, RHEL, Arch |
Users added to one of these groups can run administrative commands via sudo.
sudo (superuser do) runs a single command with elevated privileges without switching fully to the root account. Every action is logged.
sudo apt update
sudo systemctl restart sshdConfiguration lives in /etc/sudoers. Always edit it with visudo — it validates syntax before saving:
sudo visudo| Command | What it does |
|---|---|
su - |
Switch to root (full login shell) |
su <username> |
Switch to another user |
sudo -u <username> <command> |
Run one command as another user |
whoami |
Print the current user |
The - in su - loads the target user's full environment (profile, PATH, etc.). Without it you keep the calling user's environment.
| You want to... | Go here |
|---|---|
| Understand how files and directories are structured | The Filesystem |
| Go back to history commands | Command History |