How to make CSF block IPs after a certain amount of failed logins?

How to make CSF block IPs after a certain amount of failed logins to the server?
also make it notify you via e-mail of the attempts and the IPs in question

Thanks in advance for the information

Hello!

If you haven’t already used it, fail2ban is pretty good at blocking naughty IP addresses, I don’t think it has a notify function though

I don’t use any tools to block IP addresses, I just have two factor enabled for SSH, the setup linked below also skips two factor if you log in with SSH keys