Hardening is a layered process: sudo/doas policy, key-only SSH, an active firewall, and routine updates. This episode also covers auditing with lynis and rkhunter, and reviewing running services to shrink the attack surface.

A good firewall is just one layer. Episode 14 takes you through comprehensive hardening: access policy with sudo/doas, securing SSH with key-only auth, verifying the firewall, the habit of routine updates, and automated auditing with lynis and rkhunter.
Hardening isn't a one-time event, but an ongoing process. Every service added, every user created, and every package updated affects the system's security profile. Let's build the right habits from the start.
Sudo was set up in episode 7 for the wheel group. Hardening begins with restricting who can be an admin. Edit /etc/sudoers with visudo and adjust it so non-interactive root login is denied:
root ALL=(ALL) ALL
%wheel ALL=(ALL) ALLExtend the policy if your team needs restricted access. Always use visudo — it validates syntax before saving, preventing you from locking yourself out of admin rights.
doas from OpenBSD is much smaller and simpler. Install and configure it in /etc/doas.conf:
sudo pacman -S opendoas
sudo bash -c 'echo "permit persist :wheel" > /etc/doas.conf'The line permit persist :wheel lets the wheel group use doas without a password for a set duration. Switch all your sudo habits to doas on systems where you want as few dependencies as possible.
The highest-impact step: turn off password login and enable key-only auth. First, install your public key on the server:
ssh-copy-id -i ~/.ssh/id_ed25519.pub devnull@203.0.113.50ssh-copy-id adds the public key to ~/.ssh/authorized_keys. Once the key works, change the configuration in /etc/ssh/sshd_config:
PermitRootLogin no
PasswordAuthentication no
PubkeyAuthentication yes
MaxAuthTries 3PasswordAuthentication no disables password-based login entirely. Before dropping the connection, test from a separate terminal with your key so you don't lock yourself out.
Restart the SSH service, then verify from a client:
sudo rc-service sshd restart
ssh devnull@203.0.113.50If the connection succeeds without asking for a password, key-only auth is in effect. Note that changes to sshd_config don't apply until the service is restarted.
The firewall from episode 13 should be verified periodically. Check the nftables rules and UFW status if you use it:
sudo nft list ruleset | head
sudo ufw status verbosesudo nft list ruleset shows the rules currently in force. If both commands return nothing, the firewall service is probably down — fix it right away.
Most attacks exploit vulnerabilities that have already been patched. Routine updates are one of the most effective security measures:
sudo pacman -SyuGet in the habit of running pacman -Syu at least weekly. For servers, consider scheduling it via cron or a timer so it isn't forgotten — episode 16 covers safe update procedures in detail.
Lynis checks hundreds of security aspects of a system and gives a score. Install and run it:
sudo pacman -S lynis
sudo lynis audit systemsudo lynis audit system runs a comprehensive audit and shows the findings at the end. Pay attention to the Suggestions and Warnings sections — those are your prioritized fix list.
The full report is stored at /var/log/lynis-report.dat. View the hardening score and the fix list:
sudo lynis show hardening-indexThe output of lynis show hardening-index shows your current security score. After applying the suggested fixes, audit again to see the score rise.
Rkhunter scans for signs of rootkits and changed files. For one-off use:
sudo pacman -S rkhunter
sudo rkhunter --update
sudo rkhunter --check --skip-keypressThe rkhunter --check command checks the system against a signature database. Read the output and investigate lines labeled Warning.
A habit that's often overlooked: reviewing running services. The fewer services, the smaller the attack surface. List them and disable what you don't use:
rc-status
rc-update showrc-update show shows all services across all runlevels. Question every service: is it needed? If not, remove it from the runlevel with rc-update del.
Episode 14 cultivated hardening habits: strict sudo/doas policy, key-only SSH, firewall verification, routine updates, and periodic auditing with lynis and rkhunter.
Key takeaways:
/etc/sudoers or /etc/doas.conf.PasswordAuthentication no and PermitRootLogin no.pacman -Syu updates close known vulnerabilities.In the next episode, episode 15, we'll cover AUR and AURIS — yay and paru, PKGBUILD structure, makepkg as a build sandbox, and the AURIS repository for init scripts of AUR applications on Artix.