Linux Foundations for Security
The operating system where security work happens
Linux powers most servers, cloud instances and attack tools. A security analyst reads processes, logs, permissions and the filesystem the same way a pilot scans instruments — constantly and confidently.
What you will learn
- Navigate files, permissions and processes with the core command set
- Inspect logs and running services for evidence
- Reason about privilege boundaries on a Unix host
What is this?
Linux is the dominant server OS and the environment where most security tooling (tcpdump, nmap, analyzers, SIEM agents) runs. Its model centers on files, processes, permissions (read/write/execute for owner/group/other), and a root superuser. Analysts continuously enumerate what's installed, what's running, who's connected and what changed.
Why do you need it?
- Nearly every lab in this track runs in Linux — command fluency is prerequisite for everything that follows.
- Incident response on a Linux host means reading /var/log, processes and listening sockets fast.
- The permission model (mode bits, umask, sudo) is the everyday mechanics of least-privilege enforcement.
- Attack tooling (Metasploit, others) is mostly Linux-first; defenders must be as fluent as the tooling.
Mental model
A librarian who can find any book on a shelf
A Linux-savvy analyst
The librarian knows the cataloging, the aisles and who is allowed to borrow what. An analyst maps this to: filesystem, processes and permissions — knowing every resource's location, state and access rules.
How it works
- Everything is a file: devices, sockets and regular data all live under the filesystem tree.
- Permissions are mode bits: rwx per owner/group/other, plus special bits (setuid, sticky).
- Processes are tracked by PID, run as a user, and inherit a permission context.
- Logs live under /var/log (journald, syslog) and daemons register services the OS supervises.
- sudo grants controlled elevation; root is all-powerful and ops must avoid operating as root.
Reconnaissance loop on a Linux host.
Key commands
id && whoami && sudo -lEstablish identity and available privileges — the first triage trio.
ps aux --sort=-%cpu | headFind the busiest processes — a miner/coin-locker's favorite spot.
journalctl -u sshd --since '6 hours ago'Pull the SSH daemon's recent activity from its logs.
find /tmp -perm -002 -lsDetect world-writable files that could be planted by an attacker.
In production
- First response on an IR case: `ps aux`, `ss -tulnp`, `journalctl | tail`, then a hash-and-diff of binaries.
- A hardening checklist applies least privilege: non-root service accounts, disabled root login, umask 027.
- A SOC analyst greps auth.log for accepted-address anomalies to spot account takeovers before the attacker pivots.
Best practices
- Operate with least privilege: normal users, dedicated service accounts, sudo only when needed.
- Enable and centralize logging: standardize journald to a SIEM with rotation policy.
- Document the baseline: list expected binaries, listeners and users so a change stands out.
- Patch and inventory: know what's installed before the scanner does.
Common mistakes
- Running everything as root because 'it just works' — every mistake becomes a privilege escalation.
- Relying on 'nothing looks weird' instead of a written baseline.
- Ignoring log rotation until the disk fills and logging stops — attackers love silent sensors.
Debugging tips
- Strace a failing binary to see exactly where it dies (permissions, missing lib, network).
- Compare `ss -tulnp` before and after a suspected intrusion; a diff is evidence.
- When a service 'doesn't start', read journalctl -u <svc> -n 50 before touching the config.
Security considerations
- setuid binaries are classic escalation paths; scan for them (`find / -perm -4000`).
- World-writable paths and sticky-bit abuse let attackers plant trojans; audit /tmp consistently.
Interview checkpoint
Hands-on lab
- Run the standard host-triage command set you will use in incidents
- Find evidence: a rogue listener, a suspicious process and modified files
- Explain each finding in terms of expected vs suspicious behavior
Triage a Compromised Linux Lab Box
40 min · intermediate
Quick quiz
Which command lists all listening network sockets with their owning processes?
Reading /var/log/auth.log is a valid first step when investigating failed or unauthorized SSH logins.