How to create an email alert for SSH logins


Here's a neat unix/linux email trick: How to get notified via email for SSH logins, courtesy of Tech Republic's Jack Wallen. And it uses your Gmail account to send the mail, like I offered up back in 2020 (great minds think alike). You don't NEED to implement that step if your server has a good email sending reputation and history already, but if you don't -- if the server hardly sends any mail at all, you're not sure if DKIM or DMARC is set up properly, etc., then sending via Gmail is a great way to do it, letting you bypass IP warming, reputation and authentication configuration issues. Anyway, beyond that, the core of the notification setup itself is pretty simple. Click on through to see how it is configured.

Post a Comment

Comments