Skip to content

Blocking at any time interval with 3 failed attempts #3719

Closed Answered by sebres
hack3rcon asked this question in Q&A
Discussion options

You must be logged in to vote

How do I configure Fail2Ban to block if someone enters the wrong password three times in any given time period?

If emphasis is on given...
The short answer is - RTFM.

Basically:

maxretry = 3
findtime = 15m

(means 3 attempts in 15 minutes)

Blocking at any time interval with 3 failed attempts

If "any time interval" in title means rather not the given interval but really "any", then the answer is - it is impossible.

Fail2ban needs a fixed interval, because:

  • it'd hold the ticket with IP in failure queue (in memory) for this interval (remove it if time since last attempt is larger than findtime);
  • after restart it must seek to max(time_of_last_known_pos, now - findtime) in the log or journ…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by sebres
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants