I set up a fail2ban system on my server to restrict SSH access. It works fine, except that after entering the username on the unit, if I enter the password incorrect 3 times (my maxretry value), it continues to allow the user to attempt to log in. But if I remove exit from trying to log in as that user, and open a new session, I am now banned.
When using putty, I enter the target address (but not it's username
login as: user user@address's password: 1234 Access Denied user@address's password: 1235 Access Denied user@address's password: 1324 Access Denied user@address's password: 1234 Access Denied user@address's password: 1235 Access Denied user@address's password: 1324 Access Denied
In theory it should not let me log in after the 3rd try, but instead it lets me go through 6 tries, after which I get a popup about having too many authentication failures. If I then go back, fail2ban has properly blocked the device from access.
How can I get it set up so that I am kicked off right after the 3rd try?
Edit: I am aware of this question. However, I believe this is different because the poster there asks why it is not blocking at all. I am more worried about why it does not block login attempts that are already in progress.