👤 Users, Groups & Permissions
The security system that decides who can access, modify, or delete files.
🏢 Imagine An Office Building
Not everyone has access to every room.
- Employees access work areas
- Managers access additional rooms
- Executives access restricted areas
- Visitors have limited access
Linux follows the same principle.
Access must be controlled.
👤 What Is A User?
A user represents an identity on a Linux system.
Examples:
- alice
- developer
- backup-service
- web-server
Not every user is a human.
Many applications run using dedicated service accounts.
🧰 Practical Command: Who Am I?
whoami
Example output:
student
This identifies the account currently in use.
👥 What Are Groups?
Groups simplify permission management.
Instead of granting access individually:
- Developers Group
- HR Group
- Finance Group
- Administrators Group
Permissions can be assigned to groups instead of individual users.
🔍 Check Your Groups
groups
Example:
student sudo docker
This shows group memberships associated with your account.
🔐 Linux Permissions
Every file and directory has permissions.
Linux asks:
- Who owns this file?
- Who can read it?
- Who can modify it?
- Who can execute it?
📋 Viewing Permissions
ls -l -rw-r--r-- report.txt
At first this looks confusing.
Let’s decode it.
🧩 Permission Breakdown
-rw-r--r--
| Symbol | Meaning |
| r | Read |
| w | Write |
| x | Execute |
| – | No Permission |
🎯 Three Permission Levels
👥 Group
🌍 Others
Linux evaluates permissions separately for each category.
🛠 Practical Command: chmod
Make a script executable:
chmod +x script.sh
View updated permissions:
ls -l
This is one of the most common Linux administration commands.
👑 Practical Command: chown
Change file ownership:
sudo chown alice report.txt
Administrators use this regularly when managing applications and user data.
🚨 Real Incident Example
A web application suddenly stops working.
Investigation reveals:
- Application files exist
- Configuration is correct
- Server is running
Root cause:
Incorrect file permissions.
Permission problems cause outages more often than many beginners realize.
🛡 Security Principle: Least Privilege
Users should receive:
Only the permissions they need.
Not maximum permissions.
Not administrator access.
Only what is required to perform their role.
This principle appears throughout cybersecurity.
🎯 Practice Lab
whoami groups touch test.sh ls -l chmod +x test.sh ls -l
Observe how permissions change after running chmod.
💡 What Security Teams Check First
During Linux investigations:
- File ownership
- Permissions
- Group memberships
- Privileged accounts
Many security issues begin here.
🏆 Key Lesson
Permissions are one of Linux’s most powerful security features.
They protect systems from:
- Accidental changes
- Unauthorized access
- Misconfigured applications
- Excessive privileges
Good security starts with good permissions.
🔑 The Power Of sudo
Learn why Linux administrators avoid working as root and how sudo became one of the most important security controls in modern systems.
Recent Comments