Rolling Back a Broken System Update with rpm‑ostree Snapshot Recovery

When a system update goes wrong, you don’t have to reboot the whole machine

A broken update can leave a system in a state where it still boots, but services are mis‑configured, libraries are missing, or the kernel is corrupted. On a traditional RPM‑based distribution, you might end up running yum reinstall or even a full reinstall from a rescue disk. With rpm‑ostree, the recovery path is cleaner: the system is a read‑only tree that can be rolled back to a previous snapshot in a single command. This post walks through that process, explains the trade‑offs, and shows how to keep the rollback path secure and reliable.

[Read More]

Journalctl hunt for silent root‑kit after brute‑force logins

Detecting a Silent Root‑Kit After Brute‑Force Logins

Brute‑force attempts are a daily nuisance. Most of the time they’re harmless – a bot scanning for weak passwords. But when a successful login slips through, it can be the first step toward a silent root‑kit. The goal of this post is to show how to use journalctl as a hunting tool, how to spot the tell‑tale signs of a stealthy compromise, and what to do once you find something.

[Read More]

Using systemd‑journald Filters to Stop Spurious SSH Login Alerts

Spurious SSH Alerts in systemd‑journald: A Quick Filter Fix

I’ve spent a lot of time staring at the journalctl -u sshd output on busy servers. Every minute a bot tries something, and the journal fills with lines that look like:

Aug 12 12:34:56 host sshd[1234]: Failed password for invalid user admin from 203.0.113.42 port 54321 ssh2

If you forward every Failed password line straight to a SIEM or just watch the console, you’ll be drowning in alerts that are usually nothing more than failed logins from bots, mistyped passwords, or legitimate users on a shared workstation. The noise makes it hard to spot the real bad guys.

[Read More]

Diagnosing a DNS cache miss after a systemd‑resolved restart

A “no such host” after you restart systemd‑resolved usually means more than a flaky network. It’s often a symptom of stale state, a mis‑wired socket, or a broken link to your upstream nameservers. Below is a walk‑through that keeps the commands you need and skips the fluff.


Why systemd‑resolved matters for security

On Debian, Ubuntu, Fedora and the likes, systemd‑resolved is the default stub resolver. It keeps a local cache, validates DNSSEC, and is the single point that all processes hit when they read /etc/resolv.conf. If it’s not behaving, you can end up:

[Read More]

Stopping /var/log from Dooming Your Server with a Simple tmpfs Trick

Stopping /var/log from Dooming Your Server with a Simple tmpfs Trick

When a server runs out of space on the root partition, services stop, backups fail, and the machine can become unresponsive. On busy production systems the culprit is almost always the log tree under /var/log. Even with log rotation, a mis‑configured service or a sudden spike in verbosity can fill the disk in minutes. The classic fix is to move logs to a separate partition or to a remote syslog server, but that adds complexity and a new attack surface.

[Read More]

When systemd‑resolved stalls: Diagnosing and fixing the 1‑second lookup delay

On a busy host, a 1‑second DNS lookup can feel like a blink, but when it happens on every request, it adds up. In 2026, most distributions ship systemd‑resolved as the default resolver, and the default configuration is usually fine. Yet a handful of real‑world scenarios—high‑traffic web servers, containers, or networks with strict firewall rules—expose a subtle 1‑second delay that can be traced back to systemd‑resolved’s handling of upstream DNS servers.

[Read More]

Resolve DNS Cache Poisoning on Raspberry Pi with resolvectl – One‑Step Fix

DNS cache poisoning is a classic attack that can redirect traffic from a legitimate domain to a malicious IP. On a Raspberry Pi running a recent Debian‑based OS (e.g., Raspberry Pi OS 2026‑stable), the default resolver is systemd‑resolved, which exposes the resolvectl command. This guide shows how to harden that resolver in a single, repeatable step, with practical examples, caveats, and troubleshooting tips.


Why the Pi is a Target

  • Low‑cost, always‑on devices are often used as home routers, media servers, or IoT gateways.
  • Many users leave the default DNS settings unchanged, pointing to public resolvers (Google, Cloudflare, ISP).
  • A compromised Pi can become a pivot point for lateral movement or a source of DNS‑based exfiltration.

Hardening the resolver is a low‑effort, high‑impact measure.

[Read More]

When /etc/hosts Won’t Resolve: A Quick Systemd‑Resolved Fix

The Symptom

You’re pinging localhost or a custom hostname you added to /etc/hosts and the request hangs or returns “Name or service not known”. The same name resolves fine on another machine, and dig or nslookup against a public DNS server works. The problem is isolated to the local resolver. In most modern distributions this points to a mis‑configured systemd‑resolved service or a stale cache.

Why systemd‑resolved Matters

systemd‑resolved is the default name‑resolution daemon on Fedora, Debian, Ubuntu, Arch, and many other distros since 2015. It replaces the older dnsmasq‑based /etc/resolv.conf approach and offers:

[Read More]

Fixing systemd-resolved Ignoring /etc/hosts

Resolving local hostname lookups that fail silently

Ever had a host you added to /etc/hosts just stop answering? I’ve seen this happen after a kernel upgrade or a quick edit that left a stray comment. On Fedora, Debian, and Arch the culprit is almost always the local resolver: systemd‑resolved. It only reads /etc/hosts if the ResolveFile option is enabled and the service is started with --resolve. A tiny mis‑config can silence that hook.


1. Check that systemd‑resolved is actually running

systemctl status systemd-resolved.service

If you see inactive or failed, start it up:

[Read More]

Quickly Pinpointing Unauthorised sudo Attempts with Journalctl Filters

When a user or a process tries to run something with sudo, the action is recorded in the system journal. Because sudo writes to the journal, you can filter on the SYSLOG_IDENTIFIER or MESSAGE fields to spot failed attempts, audit who tried what, and even trigger alerts.

Below is a step‑by‑step guide that shows how to:

  • Identify failed sudo attempts in real time
  • Pull historical data for a specific user or time window
  • Distinguish between legitimate and suspicious activity
  • Automate the process with a small script
  • Understand trade‑offs and common pitfalls

The examples assume a recent systemd‑based distro (Debian 12, Ubuntu 24.04, Fedora 40, etc.) and that sudo is compiled with the default --syslog flag (enabled since 2019). If your system uses a custom sudo build or a different logging backend, the commands will need adjustment.

[Read More]