Linux Users, Permissions and Processes
Understand how Linux decides who can do what: users, groups, file modes, sudo, SUID, processes and scheduled jobs.
Beginner · about 6 hours · difficulty 2/5
Learn first: Linux Command Line Essentials
Nearly every Linux attack and defense comes down to permissions. Once you understand them, privilege escalation and hardening both make sense.
Users and groups
Accounts live in /etc/passwd; password hashes in /etc/shadow (readable only by root). Each user has a UID; root is UID 0. Groups grant shared access, and membership in groups like sudo, docker or adm can be as powerful as root.
File permissions
ls -l shows modes like -rwxr-x---: read, write, execute for owner, group and others. chmod 640 file and chown user:group file change them. Special bits matter for security:
- SUID on an executable runs it as the file's owner (often root). A misconfigured SUID binary is a classic escalation path.
- Sticky bit on
/tmpstops users deleting each other's files.
sudo
sudo -l lists what the current user may run as root. An entry like "may run vim as root" is effectively full root, because vim can spawn a shell.
Processes, services and scheduling
ps aux, top and /proc show what is running and as whom. Services run under systemd. Scheduled jobs live in cron (/etc/crontab, /etc/cron.d) and systemd timers. Attackers love writable scripts that root runs on a schedule; defenders audit exactly those.
Pitfalls
chmod 777to "fix" a problem. It creates new ones.- Forgetting that group membership (like
docker) can equal root.
Move on when you can look at a box and list every way a normal user might become root, and how to close each one.
Key concepts
- /etc/passwd and /etc/shadow
- File modes and chmod/chown
- SUID, SGID and sticky bit
- sudo and sudoers
- Processes and /proc
- cron and systemd timers
- Capabilities (setcap)
Mini project
In a VM, deliberately create three misconfigurations (a SUID binary, a writable root cron script, a loose sudo rule), then write a short script that detects each one.
Check yourself
Why is a user in the docker group effectively root on most hosts?
Free resources
- GTFOBins (GTFOBins)
- Linux Journey: Permissions (Linux Journey)
- Linux man pages (man7.org)