User Tools

Site Tools


ubuntu:fail2ban:override_the_default_configuration_settings_for_the_sshd_service

Ubuntu - Fail2Ban - Override the default configuration settings for the sshd service

sshd is the only service monitored by fail2ban by default.

Edit that /etc/fail2ban/jail.d/defaults-debian.conf file, and add configuration changes into the section of the sshd service.

/etc/fail2ban/jail.d/defaults-debian.conf
[DEFAULT]
banaction = nftables
banaction_allports = nftables[type=allports]
backend = systemd
 
[sshd]
enabled = true
 
# The following lines override the default values for the sshd service
bantime = 600
findtime = 3m
maxretry = 5
action = %(action_mw)s

NOTE: Various entries have been added into the [sshd] section to override the default values.


Enable the new changes

Reload fail2ban to enable the changes.

sudo systemctl reload fail2ban 

ubuntu/fail2ban/override_the_default_configuration_settings_for_the_sshd_service.txt · Last modified: 2025/05/30 21:23 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki