Get an Email notification for successful SSH logins

This is an email alert that is triggered once a SSH login succeeds

First we will create the script itself in the ssh folder /etc/ssh/login-notify.sh:

Make the file executable, then add the following line to the end of the sshd pam file in /etc/pam.d/sshd

It’s set to optional for testing, as it would prevent login if the script fails, test it first before switching it to required

Leave a comment

Your email address will not be published. Required fields are marked *