πΆοΈ Technique Card: Power and Privilege - Different Types of Linux User
Unit 101 β Terminal Tigers π― | Rank: Shadow Recruit
ShadowNet Agency: Recruit Training File β Classified Level 1
π΅οΈ Mission Prep Briefing
In every secure system, not all users are equal. Some have clearance to view confidential data, others can only access what they need. To succeed in your next mission, youβll need to understand how Linux handles users, groups, and privileges.
π€ Types of Linux Users
Linux systems have different user roles:
- root β π The one true superuser. Has complete control. There is only one root user per system.
- Regular users β Like you. Access is limited to keep the system safe.
- System users β Used by services and background processes (e.g.,
daemon
,syslog
).
To see who you are:
whoami
To see all users:
cat /etc/passwd
π§ͺ sudo β Power on Demand
Some trusted users are allowed to temporarily act like root using the sudo
command:
sudo <command>
This is only possible if you're in a special group β usually called sudo
or wheel
.
Check if you're in the sudo group:
groups
Note
The original meaning of sudo
was super user do as when using sudo
a regular user can do as the super user (root) can do
πΈοΈ Linux Groups: The Network of Trust
Every user can belong to one or more groups. Groups help control who can:
- Read sensitive logs
- Access protected directories
- Run powerful commands
Example groups:
adm
β Can read log filessudo
orwheel
β Can use thesudo
commandwww-data
β Used by web servers
See which groups you belong to:
groups
Check another user:
groups otherUser
ποΈ /etc/passwd and /etc/group
Two files tell you everything about users and groups:
/etc/passwd
β Lists all user accounts/etc/group
β Lists all groups and who is in them
Note
Passwords are NOT stored in /etc/passwd
- they are found in /etc/shadow
but this is a restricted file and even then the passwords of users have been hashed so they cannot easily be read
Explore with:
cat /etc/passwd
cat /etc/group
π Want to find all users in the adm
group?
grep adm /etc/group
π§ Clue: Try looking for patterns in these files. Who belongs to what?
π― Try This
β
Who are the users on the system?
β
What groups exist?
β
Find all the users in the adm
group.
π» Command Summary
Command | Purpose |
---|---|
whoami |
Shows your current user |
groups |
Lists your groups |
groups <user> |
Lists another userβs groups |
cat /etc/passwd |
View all user accounts |
cat /etc/group |
View all groups |
grep <groupname> /etc/group |
See whoβs in a group |
sudo <command> |
Run a command as a privileged user (if allowed) |
π§ Remember:
Not every user is what they seem. In ShadowNet, knowing who has access is just the beginning.
Stay alert. Stay curious.
β ShadowNet Academy: Question. Train. Triumph.
β¬ οΈ Go to Mission 004: Who has the Power?