Update #3 - Hardening Security of the BookStack.


After migrating my BookStack documentation system to a public-facing VPS, my next priority was to harden the server. The goal was to lock down remote access, guard against brute-force attacks, and ensure the system was updated automatically, all while maintaining reliable access for legitimate admin use.


The Setup

The VPS is running Ubuntu 22.04 LTS, hosting BookStack on a full LAMP stack. With the public site live, it was time to secure the perimeter.


The Process

1. Hardened SSH Configuration

I edited /etc/ssh/sshd_config to improve SSH security:

2025-05-04 15_10_31-Greenshot.png

Once updated, I restarted SSH:

sudo systemctl restart ssh

2. Enabled UFW Firewall

I verified UFW firewall settings to ensure only necessary traffic was allowed:

3. Installed and Configured Fail2Ban

Fail2Ban helps block brute-force attacks. After installation, it was monitoring the SSH log (/var/log/auth.log).

sudo apt install fail2ban

2025-05-04 15_18_44-Greenshot.png

Screenshot: Fail2Ban Jail Status

2025-05-04 15_19_00-Greenshot.png

4. Enabled Unattended Security Updates

To keep the VPS patched automatically, I installed and configured unattended upgrades:

sudo apt install unattended-upgrades  
sudo dpkg-reconfigure unattended-upgrades

This ensures security updates are applied daily with minimal overhead.

The Result

The VPS is now protected with hardened SSH access, firewall filtering, brute-force detection, and automatic security patching, while keeping full control over my public documentation setup.

What I Learned



Revision #3
Created 4 May 2025 20:23:14 by Nate Nash
Updated 7 June 2025 00:14:24 by Nate Nash