IT & Networking Foundations
Beginner 14 min read IT & Networking Foundations

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.

Linuxbashpermissionsprocesseslogsfilesystem
Before we start

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
Introduction

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.

Motivation

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.
Think about it

Mental model

Imagine

A librarian who can find any book on a shelf

Think of

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.

Mechanics

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.

Who am I
What's running
What changed
What's connected
Baseline verdict
Reference

Key commands

id && whoami && sudo -l

Establish identity and available privileges — the first triage trio.

ps aux --sort=-%cpu | head

Find 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 -ls

Detect world-writable files that could be planted by an attacker.

Real world

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.
Guidelines

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.
Watch out

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.
When things break

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

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.
Interviews

Interview checkpoint

Practice

Hands-on lab

Triage a Compromised Linux Lab Box
40 min · intermediate
In progress
Objectives
  • 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

0/5 steps
0%
sandbox · Linux sandbox
$
Try these commands
Test yourself

Quick quiz

0/2
1

Which command lists all listening network sockets with their owning processes?

2

Reading /var/log/auth.log is a valid first step when investigating failed or unauthorized SSH logins.

Go deeper

Official documentation