OGOPSEC // Dispatch
How to Secure a Linux Desktop: A Layered Checklist
If you are asking how to secure a Linux desktop, the useful answer is not a single setting but a set of layers, each covering what the one above it misses. No single layer is complete; the strength comes from stacking them so an attacker has to defeat several independent controls. Here is that stack, ordered roughly by how much real risk each step removes.
Layer 1: Physical and boot
Everything else assumes the machine boots the system you installed. Protect that assumption.
- Set a firmware (UEFI) password so the boot order cannot be changed casually.
- Keep Secure Boot enabled unless you have a specific reason to disable it.
- Set a GRUB password so recovery mode is not an open root shell:
Reality check: these raise the effort for an attacker with brief physical access. They do not defeat someone who removes the drive. That is the next layer's job.
Layer 2: Disk encryption
Full-disk encryption with LUKS is the single highest-value control on any portable machine. With it, a stolen laptop is a brick full of ciphertext. Most installers offer it as a checkbox during setup — take it. Retrofitting encryption later is possible but disruptive, so decide at install time.
Honest limit worth repeating: disk encryption protects a powered-off machine. Once unlocked and logged in, your files are plaintext to your session.
Layer 3: Authentication
This is where most real-world compromises are won or lost.
- Add a hardware second factor with
pam-u2fso a stolen password is not enough. - Enable lockout with
pam_faillockto blunt guessing. - If you use SSH to or from the machine, prefer keys and disable password login.
Apply the policy to every gate — greeter, console login, and sudo — not just the one you see first.
Layer 4: The session
A secured login is undone by an unlocked, unattended screen.
If you carry a hardware key, wire the screen to lock the moment the key is removed. Habit-free security beats security that depends on you remembering to press a shortcut.
Layer 5: Network surface
Do not expose what you do not use.
A desktop rarely needs to accept inbound connections at all. Default-deny inbound removes a whole category of risk for free, and you open specific ports only when you genuinely run a service.
Layer 6: Software hygiene
- Enable automatic security updates so known vulnerabilities close without you remembering.
- Prefer your distribution's repositories and signed Flatpaks over random scripts piped into a shell.
- Leave SELinux or AppArmor in enforcing mode; fix policies rather than disabling them.
Layer 7: Backups
Security is not only about keeping attackers out; it is also about surviving when something goes wrong — ransomware, a failed disk, a mistaken rm. A tested, encrypted, offline backup is a security control. The emphasis is on tested: a backup you have never restored from is a hypothesis, not a safeguard.
Putting it together
A reasonable order of operations for a new machine: choose encryption at install, set firmware and GRUB passwords, harden PAM with a hardware factor, configure idle and key-removal locking, set a default-deny firewall, enable automatic updates, and stand up an encrypted backup. None of it is exotic, and all of it is free with the tools your distribution already ships.
The layers that give you the most trouble to assemble by hand are authentication and session-locking, because they span several config files and are easy to get subtly wrong. A packaged option like Dire Wolf handles that band — hardware-anchored FIDO2 login, fail-closed PAM, lock-on-removal, and ecryptfs encryption of your home directory. Note the scope of that last part: it encrypts home, not the full disk, so LUKS from Layer 2 still belongs underneath it. State the scope, stack the layers, and a Linux desktop becomes genuinely hard to walk off with.