Table of Contents
- What is a User?
- Types of Users in Linux
- How Linux Identifies Users (UIDs)
- Where Is User Information Stored?
- Essential User Management Commands
- Summary
1. What is a User?
A user is simply someone who logs into a Linux system. Each user has an account; a unique identity, that determines:
- What they can do
- What files they own
- What resources they can access
You could think of it like this: if Linux was a house, users are the people with keys, each with different access levels.
2. Types of Users in Linux
a. System Users
These accounts are created automatically when Linux is installed. They're mostly used by the system and background services, not real people.
Examples:
-
root
– the superuser (has unlimited control) -
apache
– used by web servers -
mysql
– used by the database engine
b. Normal Users
These are the actual human users who log in to do work. They can be added, edited, or deleted by an administrator (or the root
user).
Example:
If you create a user called Hassaan
, Linux sets up an account for Hassaan
, gives them a home directory, and assigns them basic privileges.
3. How Linux Identifies Users (UIDs)
Behind the scenes, Linux assigns a UID (User ID) to every account. This UID is what the system actually uses to track users, not the usernames.
UID Ranges:
-
0 – 999
→ System Users -
1000 – 60000
→ Normal Users
4. Where Is User Information Stored?
Linux keeps user data in special configuration files:
- /etc/passwd
Stores general info like usernames, UIDs, home directories, and default shells.
- /etc/shadow
Stores password-related info (in a secure, encrypted format). Only root can read this file.
5. Essential User Management Commands
➕ Create a New User
useradd
🔑 Set or Change Password
passwd
🧾 Check User Account Info
grep /etc/passwd
🔐 Check Password Info
grep /etc/shadow
🔁 Switch to Another User
su
❌ Delete a User Account
- Keep user data:
userdel
- Delete user and their home directory:
userdel -r
6. Summary
Today’s Linux journey focused on user management, from creating users to checking their information and managing their accounts. Here’s a quick recap:
- System users vs normal users
- Linux uses UIDs to identify users (not just usernames)
- You can easily create, modify, and delete users via the terminal
- User data is stored in /etc/passwd and /etc/shadow
Tomorrow, we’ll take it a step further and dive into groups and permissions, how users interact with files and what access they have.
Until then, try running a few of these commands on your own system to explore how users are managed. You might discover some interesting things!