Log inSign up

Security guides

Firewalls inside the OS, SSH hardening, brute force protection, certificates and intrusion checks. 19 guides in this topic.

UFW firewall on Ubuntu and Debian

Allow SSH first, set a default deny for incoming traffic, open only the ports you serve and keep an automatic undo ready while you test.

firewalld on Rocky Linux and AlmaLinux

Zones, services and rich rules with firewall-cmd, tested at runtime first and saved only once a new SSH login proves the setup.

iptables rules that survive a reboot

Write IPv4 and IPv6 rule files, load them atomically with an automatic revert, and have them restored at boot on Debian, Ubuntu, Rocky and AlmaLinux.

Block brute force logins with fail2ban

Ban addresses that keep failing SSH or web logins: a jail.local with the systemd backend, progressive ban times, nginx jails and a safe allow list.

CrowdSec intrusion prevention

Install the CrowdSec agent and the nftables firewall bouncer, feed it SSH and Nginx logs, allow-list your own address and read decisions with cscli.

Two-factor SSH logins with TOTP

Require an SSH key and a six digit TOTP code from an authenticator app, with a timed rollback so a typo in PAM never locks you out.

Disable or restrict root login

Move daily work to a sudo user, then turn off root over SSH or allow it only with a key from one address, tested with a timed undo.

Alerts for every SSH login

A small pam_exec script sends a Telegram, webhook or email message whenever someone opens an SSH session, and can never stop a login.

Advanced OpenSSH settings

Allow lists, Match blocks, modern key exchange and cipher lists, SSH certificates, jump hosts and an honest look at moving SSH off port 22.

Publish SSH host keys in DNS (SSHFP)

Publish SSHFP records for your host keys in a DNSSEC signed zone so SSH clients can verify a new server without the first-connection guess.

Audit open ports with nmap

Scan your own server from outside with nmap, compare the result with what is listening locally and close every port you did not mean to publish.

File integrity checks with AIDE and Tripwire

Record a trusted baseline of system files with AIDE or Tripwire and get a report whenever a binary, config file or permission changes.

CSF firewall (ConfigServer Security)

Install ConfigServer Security and Firewall with its login failure daemon, open the ports you need in csf.conf and understand who maintains it today.

First security steps on Rocky and Alma

Update, add a sudo user, lock SSH to keys, trim firewalld, keep SELinux enforcing and turn on automatic security updates on Rocky Linux and AlmaLinux 9.

Free TLS certificates with Certbot

Get free Let's Encrypt certificates with Certbot through the Nginx or Apache plugin, webroot or a DNS challenge, and keep them renewing on a timer.

Self-signed certificates and a private CA

Create a self-signed certificate with OpenSSL for quick tests, or run a small private CA whose root you trust on your own machines.

Rate and connection limits in Nginx

Use limit_req and limit_conn in Nginx to slow brute force logins, scrapers and request floods per client IP, with a dry run before you enforce.

Wazuh security monitoring

Run the Wazuh manager, indexer and dashboard on one server, enroll agents on your other machines and review alerts, file changes and vulnerabilities in one place.

Kernel and sysctl hardening

Tighten network and kernel settings with a sysctl drop-in file, mount /dev/shm without exec rights and verify every value after a reboot.