How to Detect and Fix a Silent NFS Export Leak on a Home NAS

Silent NFS Export Leaks on Home NAS

Running a lightweight NFS server on a Raspberry Pi or a small Ubuntu Server is a common way to share media or backups.
The problem? A mis‑configured export table can let a client mount a directory that was never meant to be exposed. The server happily replies “yes”, so the admin might not notice until a log entry pops up or a backup job starts to fail.

[Read More]

Configuring systemd‑resolved to Use a Custom DNS Server Only on the VPN Interface

Why split DNS between interfaces?

When a machine plugs into a VPN it usually needs to look up hostnames that live only inside that tunnel.
If you let the whole system talk to the same nameserver, two things can go wrong:

  • The VPN’s DNS might not be reachable until the tunnel is up, so internal lookups fail.
  • Public resolvers get handed internal queries, leaking sensitive names to the outside world.

Binding a dedicated DNS server to the VPN link keeps the resolver stack tidy, cuts the attack surface, and stops accidental leaks.

[Read More]

How to Give the Backup User Read‑Only Access to /var/log via ACLs Without Granting sudo

ACLs for log‑only access

When you need a user to read system logs but you don’t want to give them sudo or pull them into a privileged group, POSIX ACLs are the cleanest way to do it.
They let you hand out read rights on a per‑file or per‑directory basis, and you can set defaults so that every new file inherits the same restrictions.

A backup account that pulls logs to an off‑site archive but never touches the live system is the classic case. ACLs keep the principle of least privilege intact while still letting the job run unattended.

[Read More]

Using ACLs to give a group write access to /var/www/html without changing ownership

Why ACLs instead of changing ownership?

When a web server runs as www-data and the dev squad needs to touch files in /var/www/html, the quick fix is usually chgrp the directory and slap a write bit on the group. That swaps the group ownership, which can trip up services that expect the original group or automated deploy scripts that hard‑code the owner. ACLs let you hand out the right permissions without touching the classic ownership columns.

[Read More]

Fixing the “Permission denied” error when mounting a host directory into a rootless Podman container

Rootless Podman runs containers as an unprivileged user, so a bind‑mount that works for root often fails with “Permission denied.” That error is usually a mismatch between the host directory’s ownership/permissions and the container’s user namespace. Below is a quick checklist that gets the mounts working again while keeping the isolation tight.

Common Causes

Cause Why it happens Typical symptom
File ownership The host directory is owned by root or another UID that the container’s user can’t read/write. mount: permission denied or open /data/file: Permission denied inside the container.
SELinux/AppArmor context The host directory’s security context blocks the container’s process. Same “Permission denied” even when file permissions look right.
User‑namespace mapping Podman maps container UID 0 to a non‑zero host UID. If the host directory is owned by root, the mapped UID has no rights. Error appears only when --userns=keep-id is omitted.
Mount options Using :Z/:z incorrectly or omitting them when SELinux is enabled. SELinux denies the mount, causing the error.

Quick Fixes

  1. Match ownership

    [Read More]

Eliminating 10,000‑Line DHCP Server Spam in Syslog Without Disabling the Service

Problem: DHCP Spamming Syslog

A running DHCP server can generate thousands of “client request” and “lease granted” messages every hour. On busy networks this inflates /var/log/syslog to 10 k lines a day, making it hard to spot genuine errors and bloating disk usage. The service must stay online, so the goal is to silence the noise without turning the daemon off.

Why You Can’t Just Disable the Service

Disabling dhcpd or dhcp-server removes the spam but also removes the ability to hand out IPs. In a homelab or small office you may have a separate DHCP server (e.g., a router) that you can stop, but in many setups the Linux box is the sole DHCP provider. The logs are useful for troubleshooting mis‑configurations, but the volume is excessive.

[Read More]

Preventing the “chmod 777” Disaster: How ACLs Can Protect Your Shared Downloads Directory

The “chmod 777” disaster is a myth, but the habit that leads to it is real

Shared download directories are a staple in home labs, small‑business servers, and even personal media stacks. The temptation to give everyone write access with chmod 777 is strong: it feels quick, it works, and it seems harmless. In practice, it opens a door for accidental deletion, privilege escalation, and data corruption. The Linux ACL subsystem is a lightweight, kernel‑level solution that lets you grant fine‑grained permissions without abandoning the familiar chmod/chown workflow.

[Read More]

Taming Log Noise with systemd's Built-in Journalctl Filters and Priorities

Introduction to Journalctl Filters

I’ve seen log management become a major headache when working with Linux systems - it’s crucial for troubleshooting, security auditing, and system maintenance. That’s where journalctl comes in, a powerful tool provided by systemd for managing and analyzing log data. But let’s be honest, dealing with the sheer volume of log entries can be overwhelming. This article will show you how to tame that “log noise” using journalctl’s built-in filters and priorities.

[Read More]

Taming Runaway Background Jobs with `nohup` and `ionice`

Introduction to Background Jobs

I’ve seen this go wrong when you’re running commands or scripts in the background - if not managed properly, these background jobs can consume system resources, leading to performance issues or even security risks. That’s why I’m a big fan of using nohup and ionice to tame runaway background jobs. In this article, I’ll walk you through some practical examples and security considerations for using these tools.

[Read More]

Taming Log Noise with Logrotate and a Little Elbow Grease

Introduction to Log Noise

I’ve seen this go wrong when log noise gets out of hand - it’s like trying to find a needle in a haystack. With the complexity of Linux systems increasing, log noise has become a significant problem for sysadmins, self-hosters, and developers. Luckily, we have logrotate to help tackle this issue. It’s a standard tool on most Linux distributions, including Debian, Arch Linux, and Red Hat.

[Read More]