Web Hosting & VPS Tips

Unleash Your Server Potential with Expert Insights

Hosting provided by: Cloudways
Free to Try! Up to 40% Off!

Category: VPS Setup

Turn on detailed UFW logging on Ubuntu to monitor firewall activity—install UFW with
apt install ufw
then set logging to medium with
ufw logging medium
Allow SSH (ufw allow 22) HTTP (ufw allow 80) and enable with
ufw enable
View logs with
tail -f /var/log/ufw.log
—expect entries like \"[UFW BLOCK] IN=eth0 SRC=203 0 113 1 DST=your_ip PROTO=TCP SPT=12345 DPT=22\" Rotate logs by editing /etc/logrotate d/ufw with
nano /etc/logrotate.d/ufw
setting daily and rotate 7 On Hetzner this tracks SSH and FTP attempts aiding Fail2ban configs and maintaining uptime by identifying threats

Back to All Tips