/labs

Hands-on guides and configuration walkthroughs for real tasks I've worked through - bigger than a single command, smaller than a full project.

Ansible on RHEL 10: Partitions, LVM and Swap with the Storage Role

The third lab in the Ansible series: one playbook gives server1 and server2 an XFS partition on /backup, a volume group with a logical volume on /data and swap on LVM, all mounted by UUID in /etc/fstab. Growing the volume is a one-line change. Includes a partition name that made a new partition on every run, a swap resize the role skipped without a word, and safe mode refusing to format a disk that still had data on it.

linuxrhelansibleautomationlvmstorageswapsysadmin

Ansible on RHEL 10: Offline Repositories for Every Server

The second lab in the Ansible series: one playbook mounts the installation ISO on server1, serves it over HTTP and points both servers at it, with BaseOS and AppStream defined once and a group variable deciding whether a server reads them from disk or over the network. Includes facts that went stale after a remount, a check mode that reported nothing to do on an unmounted repo, and the rhel-system-roles firewall role working with no internet.

linuxrhelansibleautomationdnfrepositorieshttpdsysadmin

Ansible on RHEL 10: Control Node and a Dedicated ansible User

The first lab in a series that automates RHCSA tasks with Ansible: server1 becomes the control node for itself and server2, a dedicated ansible user gets an SSH key and passwordless sudo, and a project directory gets its own ansible.cfg and inventory. Includes an ansible.cfg that was silently ignored, a pipe the command module didn't understand, and a broken sudo rule that Ansible couldn't fix without a password.

linuxrhelansibleautomationsshsudosysadmin

Triggering a Job When a File Arrives with systemd Path Units

Processing CSV files the moment they land in /srv/incoming on RHEL 10, with a .path unit instead of a cron job that checks every five minutes: DirectoryNotEmpty= and a half-written file it picked up, the .part upload pattern, PathExistsGlob=, a stuck file that hit the start limit and silently disabled the watcher, and a script that moves bad files aside.

linuxrhelsystemdautomationschedulingsysadmin

One-time Jobs with at and batch

Scheduling a job to run once on RHEL 10 instead of adding a cron line you have to remember to delete: at with clock times and relative times, atq, at -c and atrm, why at -f copies the script, output with no mail server, at.allow and at.deny, jobs that catch up after downtime, and batch waiting for the load average to drop.

linuxrhelatschedulingautomationrhcsasysadmin

Catching Up Missed Jobs with anacron

A daily disk report on a RHEL 10 server that's switched off at night, so a cron job at 02:00 never fires: how cron.hourly starts anacron, /etc/cron.daily and run-parts naming rules, a custom /etc/anacrontab line with its own period, timestamps in /var/spool/anacron, RANDOM_DELAY and START_HOURS_RANGE, and testing with anacron -n -d.

linuxrhelanacroncronschedulingautomationrhcsasysadmin

Ad-hoc Timers and One-off Jobs with systemd-run

Running a job later, or right now, as a real systemd unit without writing a unit file: --on-active and --on-calendar timers, why a 10-second timer fired 44 seconds late, the environment systemd-run doesn't pass on, --wait and --pipe for exit codes and output, MemoryMax= and CPUQuota= limits on a single command, cancelling, and why transient timers don't survive a reboot.

linuxrhelsystemdsystemd-runschedulingautomationsysadmin

Running a Rootless Podman Container as a systemd Service with Quadlet

A static website in a rootless nginx container, run by a regular user and managed by systemd through a Quadlet .container file: why su - breaks systemctl --user, why the unit can't be enabled, an image that exits silently without Exec=, loginctl enable-linger for starting at boot without a login, Restart=on-failure, and the rootless limits - port 80, SELinux :Z and subuid mapping.

linuxrhelpodmancontainerssystemdrhcsasysadmin

Adding Persistent Swap on an LVM Logical Volume

Extra swap carved out of the vg_data volume group from the LVM lab: a new logical volume, mkswap, swapon, a priority higher than the existing swap, an /etc/fstab entry tested with swapon -a (mount -a ignores swap), and growing it later - including why lvextend -r refuses swap and a mkswap that has to be rerun.

linuxlvmswapstoragerhelrhcsasysadmin

Replacing a cron Job with a systemd Timer

The nightly backup from the cron + rsync lab, moved to a systemd service and timer on RHEL 10: a oneshot service tested on its own first, a calendar schedule checked with systemd-analyze, Persistent=true catching up a run missed while the server was off, OnFailure= alerts instead of MAILTO, and why flock is no longer needed.

linuxrhelsystemdcronbackupsysadmin

Serving the Local ISO Repository Over HTTP to an Offline Network

One RHEL 10 server with the install ISO mounted becomes the package source for every other machine on an air-gapped network: httpd serving /repo, the SELinux mount-context fix that restorecon can't do on a read-only ISO, a firewall opening, and client .repo files pointing at it over plain HTTP with GPG checking still doing the real security work.

linuxrheldnfrepositorieshttpdselinuxsysadmin

Resetting a Lost Root Password on RHEL 10, Step by Step

The rd.break procedure done for real on a VM: interrupting GRUB, dropping into the initramfs shell, remounting /sysroot, changing the password inside a chroot, and handling SELinux correctly - with a full relabel or the faster enforcing=0 + restorecon route - then locking the door with a GRUB password.

linuxrhelbootgrubselinuxrhcsasysadmin

Setting Up Repository Access From the Install ISO, Fully Offline

A RHEL 10 machine with no internet, no Red Hat CDN and no Satellite - turning the installation DVD into a persistent ISO file, loop-mounting it via /etc/fstab, and defining BaseOS and AppStream as local dnf repositories with GPG signature checking left on.

linuxrheldnfrepositoriessysadmin

Setting Up LVM on a New Disk, From Scratch

A new disk, built into usable storage through all three LVM layers (PV -> VG -> LV), formatted, mounted persistently via /etc/fstab, and - the part that's the actual point of LVM - extended later with a second disk, with the original data confirmed intact afterward.

linuxlvmstoragerhelsysadmin

Diagnosing an SELinux "denied" Problem on a Real Service

Nginx returns 403 for a site moved to a non-standard directory, even though every Unix permission looks correct. Diagnosing it's actually SELinux, reading the denial, and fixing it permanently with semanage fcontext + restorecon instead of the chcon shortcut or disabling SELinux.

linuxselinuxnginxtroubleshootingrhel

Automating Backups with cron and rsync

A practical end-to-end backup pipeline for a WordPress site: mysqldump plus rsync's --link-dest incremental snapshots, scheduled safely with cron and flock, pruned automatically, and actually verified with a real restore - including a --link-dest gotcha that silently breaks deduplication if missed.

linuxbackuprsynccronsysadmin

Customizing the Bash Prompt (PS1)

Recolor the Bash prompt in ~/.bashrc using 256-color escape codes: the existing color_prompt block every Debian/Ubuntu install already has, the \[ \] wrapping rule, reusable color variables, and a few ready-to-use prompt variants (exit-status-aware, git branch, two-line, minimalist).

linuxbashbashrcterminalcustomization

Hardening a Fresh Linux Server

A practical hardening checklist for a freshly provisioned Ubuntu/Debian server: users and SSH, firewall and fail2ban, automatic updates, time sync, kernel/network tuning, and the mistakes that lock you out.

linuxsecurityhardeningsshsysadmin

WordPress on Nginx Troubleshooting Cheat Sheet

Symptom-to-fix runbook for WordPress served by Nginx and PHP-FPM on Ubuntu: gateway errors, permissions, database issues, TLS, performance and server housekeeping.

linuxnginxwordpresstroubleshootingsysadmin

Host One or Multiple Websites with Nginx on Ubuntu Server

Set up Nginx server blocks, PHP-FPM, MySQL, and WordPress for one or more websites on Ubuntu.

nginxubuntuweb-serverwordpress