/secure-server-skills:fail2ban-setupfrom secure-server-skills
Audits and configures Fail2ban SSH jails on Ubuntu/Debian. Inspects log backends, filter behavior, and ban enforcement, then applies or activates jail settings.
Ships in secure-server-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Protect the selected logging service without replacing unrelated jails or trusted-address policy. A process that is running may still have an inactive or ineffective jail.
ignoreip values. Review administrator access before testing bans./var/log/auth.log, /var/log/secure, or only journald. For journal-only systems, confirm python3-systemd and the installed SSH filter's journalmatch support.Read references/fail2ban-filters.md when choosing backends, filter modes, custom application filters, or a controlled test.
Install Fail2ban and required backend packages within the authorized scope if absent. Preview scripts/setup-fail2ban.sh:
sudo bash scripts/setup-fail2ban.sh --dry-run
Pass --ssh-port for every actual listener when socket activation/custom ports make discovery ambiguous. For an authorized SSH jail change and activation:
sudo bash scripts/setup-fail2ban.sh --apply --activate
The helper writes only jail.d/99-secure-server-sshd.local, selects file polling or the systemd backend, preserves existing ignoreip and other jails, and validates configuration before activation. It uses the installed sshd filter with five failures in ten minutes and a one-hour ban. These are adjustable local policy choices, not universal Fail2ban defaults. Without --activate, the running service is unchanged.
Do not enable recidive or application jails unless their actual log source, filter and ban action are verified. Aggressive SSH behavior is an installed sshd filter mode, not a presumed sshd-aggressive.conf file.
The helper validates merged ban-action ports and TCP coverage. Installed iptables/nftables all-port actions require explicit --allow-allports approval; custom actions that cannot be verified need a manual procedure. Active-service reload and recovery select only sshd. Starting an inactive service loads all enabled jails and must be reviewed accordingly.
sudo fail2ban-client -t and check sudo fail2ban-client status sshd after activation.Report running-service, active-jail, filter-match and actual enforcement evidence separately.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub mikr13/secure-server-setup-skills --plugin secure-server-skills5 skills in this plugin
/auto-updatesAudit or configure unattended upgrades on Ubuntu/Debian. Use for security-update scheduling, allowed origins and reboot policy./backup-strategyDesign and verify Linux backups and recovery. Use for file/database jobs, encryption, retention, S3 transfer and restore tests./firewall-configurationAudit or configure UFW on Ubuntu/Debian. Use for source-restricted services and IPv4/IPv6 network exposure checks./ssh-hardeningAudit or harden OpenSSH on Ubuntu/Debian with verified key access. Use when changing authentication or administrative SSH access.