Fixing “Permission denied (publickey)” after moving /etc/ssh/sshd_config

“Permission denied (publickey)” after moving /etc/ssh/sshd_config

Moving the SSH daemon’s config file is one of those quick‑fixes that turns into a full‑blown headache. The first thing I see in production is the classic “Permission denied (publickey)” on every login attempt. In practice, it’s almost always a permissions or path mis‑match.

1. Verify the new location

# Example: moving to /opt/sshd/sshd_config
sudo mkdir -p /opt/sshd
sudo mv /etc/ssh/sshd_config /opt/sshd/

The daemon still expects /etc/ssh/sshd_config unless you tell it otherwise. I usually edit the systemd unit with a drop‑in:

[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]

Debugging flaky DNS on a Raspberry Pi bridge setup with nftables rules

Flaky DNS on a Raspberry Pi Bridge – A Quick Debug Guide

Running a Pi as a network bridge can feel like a walk‑through of a maze. The bridge interface (br0) sits right between your LAN and the Pi’s Wi‑Fi or Ethernet, and if DNS starts to act up, it’s usually the bridge’s handling of UDP or some nftables rule that’s tripping up. Below is a no‑frills, coffee‑talk style walk‑through to isolate and patch the problem while keeping the bridge tight.

[Read More]

Nftables log‑filter tricks to find hidden routing loops on a bridged LAN

Bridged LANs, Routing Loops, and Nftables Log‑Filtering

Bridged LANs are everywhere—from a tiny home lab to a mid‑size office. When a bridge gets a wrong port or a VLAN slips through, packets can start circling forever. The symptoms are subtle: a CPU spike on the bridge, packet loss, and a traffic burst that looks like a DoS. The problem is that the packets never hit a firewall rule that drops them—they just bounce, so you’re left staring at a wall of traffic with no obvious culprit.

[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]

Fixing a Crashed Btrfs Subvolume After Unexpected Reboot

When a Btrfs Subvolume Crashes After an Unexpected Reboot

A sudden power loss or kernel panic can leave a Btrfs filesystem looking fine on the surface while hiding corruption inside a subvolume. The root of the issue is that Btrfs’ copy‑on‑write guarantees only hold if the metadata journal gets flushed. If the machine dies before that flush, the subvolume can become inconsistent and btrfs check will start complaining. The silver lining is that Btrfs ships with a handful of tools that, when used the right way, can recover most of the data. Below is a practical walk‑through that covers:

[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]

Recovering a Kernel Panic After Adding a New Initramfs Module

Kernel Panic After Adding a New Initramfs Module – How to Recover

Dropping a new module into an initramfs and watching the machine go black is a classic “what‑did‑I‑break‑this” moment. In the real world, the culprit is almost never the module itself; it’s usually a mis‑configured initramfs, a missing dependency, or a kernel‑level feature that got turned off by accident. Below is a practical, step‑by‑step recovery guide that keeps hardening in mind, gives you concrete commands, and explains the trade‑offs you’ll face when rebuilding the initramfs.

[Read More]

Multi‑jump bastion access without storing keys: practical ssh‑agent forwarding

Multi‑jump Bastion Access Without Storing Keys

When you need to reach a private host behind a bastion, the first thing most people do is drop a private key on the jump machine and use it to hop over. That’s quick, but it gives the bastion a copy of the key it never should have. A cleaner pattern is to forward your local ssh‑agent through the bastion so the key never lands on the jump host.

[Read More]