CentOS: E-mail notification of failed ssh login attempts

bashcentosscriptingSecurityssh

Under CentOS, I need a script that will run every 10 minutes and e-mail me if there are any new failed ssh login attempts in /var/log/secure.

Best Answer

Why not considering to use fail2ban or SSHGuard. Fail2ban seems configurable to send emails. These are better than any script written within 5 or 10 minutes.

Also, such solutions can protect you other than just sending emails.