TransWikia.com

Fail2ban unbans before restart and then rebans after restart, even though dbfile is set

Server Fault Asked by Kuhron on November 14, 2021

I am new to running a web server. I have fail2ban version 0.9.3 on Ubuntu 16.04.6 LTS. I am pretty sure I have the latest version of fail2ban and just today updated all packages with apt.

Whenever I restart the box or the fail2ban service, fail2ban takes a long time (~1 minute?) to shut down, and by tailing its log I can see that it is systematically unbanning thousands of IPs in the sshd jail in numerical order. Once the service restarts, it spends tons of time (multiple hours) and CPU re-banning those same IPs in order (it takes a second or two for each one, which to me seems to indicate that it is NOT actually reading from a db but is instead reading log files).

I would like it to never unban them in the first place.

I have looked for other questions about this issue, such as this one, and I checked that dbfile is set. The log states upon restart that the db has been connected to, so that is not the issue. Most of the info I can find about this issue seems to be from before fail2ban made persistent dbfile the default behavior.

This is such a huge waste of CPU and I am getting charged for it. How can I stop this?

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP