i'am tried with this command and no ban accured if i lfailed to login more than 5 time
sudo apt-get install fail2ban
sudo cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local
> /etc/fail2ban/filter.d/odoo-login.local
nano /etc/fail2ban/filter.d/odoo-login.local
Add in the file:
[odoo-login]
enabled = true
port = http,https
bantime = 900 ; 15 min ban
maxretry = 4 ; if 4 attempts
findtime = 600 ; within 10 min
logpath = /var/log/odoo11/odoo11-server.log
Add in the following content:
[Definition]
failregex = ^ \d+ INFO \S+ \S+ Login failed for db:\S+ login:\S+ from <HOST>
ignoreregex =
sudo fail2ban-client reload
i need to know what makes it not working well and not ban if wrong logins
Check the below thread:
https://www.odoo.com/forum/help-1/question/fail2ban-not-detecting-failing-logins-from-odoo-11-log-134095
that's not solved question
can you see a log entry of fail attempt in your log file?