A cybersecurity guide to the universe. Practical, no-nonsense privacy and security habits for everyday Linux users: encryption, hardening, safe defaults, and a healthy skepticism toward security theater.

Get the order of operations right here in particular — several of these change what your machine is reachable on, and getting the sequence wrong is the single most common way people accidentally lock themselves out of their own remote server.
A VPN doesn't remove trust from the equation, it relocates it — from your ISP to the VPN provider. Picking one because of a catchy ad instead of a track record just means trusting a company you know less about than the one you were trying to get away from. Look for an independently audited no-logs policy (not just a claim on the homepage), a jurisdiction with reasonable legal protections, and ideally a provider that's already been tested for real — a server seizure or subpoena that turned up nothing useful, documented publicly.
GOOD TO KNOW: "No logs" is a claim until it's been independently audited or tested in court. Read the audit report, not the marketing page.
Example: DNSOverTLS=yes in /etc/systemd/resolved.conf, then systemctl restart systemd-resolved. Without this, every domain name you look up travels the network in plain text — trivially readable by your ISP, a coffee shop's router, or anyone else on the same network segment, even when the website itself loads over HTTPS afterward. Confirm it actually took effect with resolvectl status and check for "DNSOverTLS: yes" next to your active interface — a saved config file that didn't get picked up is a very easy thing to miss.
Example: nmcli connection modify Wi-Fi wifi.cloned-mac-address random. Stops passive tracking of your device across networks and venues by its hardware address alone — retail Wi-Fi analytics and some ad networks build surprisingly detailed movement profiles from nothing but MAC addresses seen at different access points over time.
GOOD TO KNOW: Randomization only helps until you log in somewhere identifiable on that connection — at that point the network operator can link the session to you anyway. It closes the passive-tracking gap, not the active one.
Full-disk encryption with LUKS at install time protects swap, temp files, and application logs too — not just the documents folder most people think of first. A "just encrypt home" setup still leaves plenty of sensitive fragments (crash dumps, cache files, swapped-out memory) sitting in the clear on the rest of the disk.
cryptsetup luksOpen protects data at rest — while the machine is powered off or the volume is locked. Once the disk is unlocked and the system is running, the data is exactly as exposed as it would be on an unencrypted disk; full-disk encryption defends against a stolen or seized machine, not against a compromise of the running system.
Swap can contain sensitive memory contents — passwords typed into forms, decrypted document fragments, private key material — even from a session that otherwise felt perfectly secure. Set it up with cryptsetup and a random key generated at each boot (/dev/urandom-backed), since swap doesn't need to survive a reboot the way your root filesystem does.
Everything in this category changes how you're allowed to reach a machine remotely — test each change from a session or console access you can fall back on, not the only connection you have to the box.
Example: PasswordAuthentication no in sshd_config, then systemctl restart sshd. Key-based auth alone removes an entire class of brute-force login attempts — there's simply no password to guess.
CAUTION: Confirm key-based login actually works in a second, separate terminal before you close the session you're currently using to make this change. If the key isn't set up correctly, this locks you out with no password fallback left.
`` # In sshd_config: PubkeyAuthentication yes PasswordAuthentication no PermitEmptyPasswords no ``
Example: PermitRootLogin no — log in as a normal user and use sudo instead, so every remote action is attributable to a specific person, not to an anonymous "root." Combine this with the password-auth change above and every login is both traceable and key-verified.
CAUTION: Make sure your non-root user is already in the sudoers group and can actually authenticate with a key before you disable root login — otherwise you can end up with a server nobody can administer remotely at all.
Example: ssh-keygen -t ed25519 -C "you@example.com". Smaller, faster to verify, and it sidesteps 1024-bit RSA keys — genuinely weak, and still floating around in old scripts, tutorials, and forgotten authorized_keys files from years ago. (2048-bit RSA isn't in the same boat: NIST still rates it acceptable, with no sunset date currently in view — but ed25519 remains smaller and faster to verify regardless, so there's little reason to reach for RSA at all for a new key.)
A few of these change what's allowed to run or connect on the machine — test on a non-critical box or a snapshot/VM first, since an overly strict policy can break a working service just as effectively as an attacker could.
Example: aa-status shows which profiles are enforcing versus merely logging. A profile stuck in "complain" mode isn't protecting anything yet — it's just taking notes; move confirmed-safe profiles to aa-enforce deliberately, one at a time.
Example: systemd-analyze security sshd.service scores a unit's sandboxing on a 0–10 exposure scale and lists exactly which hardening directives are still missing, with suggestions — a genuinely useful starting checklist rather than a vague "harden your services" instruction.
Directives like ProtectSystem=strict, NoNewPrivileges=yes, and PrivateTmp=yes shrink what a compromised service can actually reach, even if an attacker gets code execution inside it.
CAUTION: Test overrides on a copy of the service first — an overly strict sandbox can silently break a service that needs to write to a path you didn't account for, and the failure often just looks like the service refusing to start with a vague error.
`` # systemctl edit myservice.service [Service] ProtectSystem=strict ProtectHome=yes NoNewPrivileges=yes PrivateTmp=yes ``
privacy.resistFingerprinting in about:config normalizes your browser's reported fingerprint — screen size, timezone, fonts, canvas rendering — so you blend in with thousands of other users instead of standing out as a unique, trackable configuration.
GOOD TO KNOW: This setting can break some sites in small ways (odd timezone display, blocked canvas-based features) — it's a real tradeoff between fingerprinting resistance and everyday convenience, not a free lunch.
Firefox's Multi-Account Containers extension isolates cookies and site data per container, so your shopping tab genuinely can't see what your banking tab is doing — and neither can the ad networks embedded on either site, since they can't correlate identifiers across the container boundary.
Example: flatpak override --nofilesystem=home org.example.App. Most Flatpak apps request far more filesystem access than they actually need by default — flatpak info --show-permissions org.example.App is worth running on anything you install, since "sandboxed" doesn't automatically mean "tightly sandboxed."
KeePassXC (local, encrypted database, no cloud dependency) or Bitwarden (synced across devices) both beat "the same password with a number appended" by an enormous margin — a password manager lets every single account have a genuinely unique, high-entropy password without you needing to remember any of them.
A FIDO2 key — pamu2fcfg for local login, WebAuthn for supported sites — resists phishing in a way SMS and app-based one-time codes fundamentally can't, because the cryptographic challenge is bound to the actual site's domain and can't be relayed to a fake one.
A leaked password from an unrelated breach is only dangerous to accounts that reuse it — which, for most people, is most of them, because breaches happen to services you don't control and can't predict. A password manager removes the friction that makes reuse tempting in the first place.
Two of these tips involve commands that permanently destroy data with no undo — double-check the target device name before you run anything here, every single time.
Wear leveling means the physical flash cells behind a file's logical block address move around constantly, transparently, as part of normal SSD operation. Overwriting a file "in place" with shred often never touches the actual physical data on flash storage at all — the drive just writes the new pattern to a different physical cell and marks the old one as stale.
Deleting the LUKS key (cryptsetup luksErase or simply destroying all key slots) is instant, verifiable, and doesn't depend on the physical quirks of the storage medium the way file-shredding tools do — cryptographic erasure sidesteps the wear-leveling problem entirely instead of fighting it.
Example: exiftool -all= photo.jpg — removes GPS coordinates, device model, and timestamps most people never realize are embedded in the file. For a whole folder at once: exiftool -all= -r /path/to/folder.
HISTCONTROL=ignorespace in your shell config lets you prefix any sensitive command with a leading space to keep that one line out of history entirely — handy for a one-off command containing a password or token you don't want sitting in ~/.bash_history indefinitely.
SystemMaxUse=200M in /etc/systemd/journald.conf caps retention by size. Check journalctl --disk-usage to see what's already piled up by default — on a long-running server it's often far more than people expect, and it's rarely been reviewed for what's actually in it.
/var/log/auth.log keeps a running record of every sudo invocation, every SSH login attempt (successful or not), and every su — useful for spotting intrusions, and just as useful to anyone else who gets read access to that file, which is worth remembering when setting its permissions.
This is the category where the cheapest tips (a screen lock shortcut, a cable lock) prevent the same real-world outcomes as some of the more elaborate technical ones — don't skip the physical basics because they feel less "technical."
loginctl lock-session bound to a keyboard shortcut removes the excuse of "it's just for a second" — the average opportunistic look-over-the-shoulder or quick USB-drop attack takes far less time than that "second" actually lasts.
Without one, boot order and boot media can potentially be changed by anyone with a few unsupervised minutes and a USB stick, opening the door to boot-time attacks that happen before your disk encryption ever gets a chance to matter.
CAUTION: Write this password down and store it somewhere separate from the machine. Forgetting a BIOS/UEFI password can mean a trip to the manufacturer or, on some hardware, replacing the motherboard entirely — there's often no user-accessible reset.
Opportunistic laptop theft doesn't care how good your encryption is if the machine simply walks out the door while you're in line for coffee — a cable lock is cheap, unglamorous, and stops the single most common physical-security failure mode outright.
Tails boots from removable media and forgets everything on shutdown by design, routing all traffic through Tor automatically — a fundamentally different guarantee than "a privacy-focused desktop" that just happens to be configured carefully, because nothing persists between sessions unless you explicitly set up encrypted persistent storage.
Separate qubes (individually isolated VMs) for banking, browsing, and work mean a compromise in one doesn't automatically become a compromise of everything — the security boundary is enforced by the hypervisor itself, not just by discipline or careful browsing habits.
Routing all traffic through Tor at the gateway VM level protects against a compromised workstation VM leaking your real IP even if malware gets full control of it — a meaningfully different, stronger threat model than a browser-only Tor setup, where a single browser exploit can potentially deanonymize you directly.
It does, the same way removing a smoke detector fixes it beeping. It works, right up until it very much doesn't — and by then the file or directory has usually been writable by literally anyone on the system for however long it took to notice.
Moving from 22 to 2222 cuts down on automated scanner spam cluttering your logs. It does nothing against anyone actually targeting you specifically — a targeted attacker runs a full port scan in seconds and finds it immediately. Worth doing for your sanity and your log's signal-to-noise ratio — not for your safety.
Attackers know that trick too — it's one of the first substitutions any modern cracking wordlist tries. Length and genuine randomness matter far more than the handful of predictable pattern substitutions everyone, including the attacker, already expects.
Related guides: 100+ Tips & Tricks — Ubuntu Server 26.04 LTS, 100+ Linux Commands. From the books: Ubuntu Server, Distilled for Ubuntu Server in depth. All free guides are in the library.