How to get Fail2Ban to work on Debian 12

Описание к видео How to get Fail2Ban to work on Debian 12

This video is for users having a problem with default Debian 12 and fail2ban installation for SSH access. This is my working method byut feel free to improve it by using my reference links to some other custom configurations in order to protect other services.

Steps in this video to configure Debian12 with fail2ban.

1 Enable root ssh access
nano etc/ssh/sshd_config
And find and add a new line
PermitRootLogin yes
(This is optional) u can use local user instead of root.

2 Install fail2ban and ufw (firewall)
apt install fail2ban -y
apt install ufw -y

3 Enable firewall to start at the boot and add ssh allow rule to gain access.
ufw enable
ufw allow ssh
ufw reload

4 Create fail2ban local config file and include your necessary changes.
nano /etc/fail2ban/jail.local

Include code below and adjust it to your needs (Bantime maxretry etc.)

[DEFAULT]
backend = systemd
banaction = ufw
bantime = 15m
findtime = 15m

[sshd]
enabled = true
port = ssh
filter = sshd
logpath = /var/log/auth.log
maxretry = 3

"ctr+x" to exit and save the config - follow the prompts


5 Start and enable fail2ban to start with system
systemctl enable fail2ban
systemctl start fail2ban
systemctl status fail2ban

To see logs and activity run command:
tail -f /var/log/fail2ban.log


Other references and websites

https://wiki.crowncloud.net/?How_To_P...

This one has extra troubleshooting tips
https://www.howtoforge.com/using-fail...

This one is great for additional customizations and configuration.
https://linuxcapable.com/how-to-insta...

*this is 2nd rev. video with corrected audio noise level.

Комментарии

Информация по комментариям в разработке