This script sends an email in HTML format at each authentication for one or several specific users.
You can apply the launch of this script for each of the PAM modules.
Recommended:
- sshd
- su
- sudo
The loginalert application requires the following additional packages to work.
Use apt-get command to install these dependencies.
- mutt
- whois
- gpgsm
Installation and Configuration
Example of an email alert with an authorized IP address.
Tip
- Send alerts to one or more email addresses simultaneously.
- Create exclusions for your legitimate IP addresses or IP address range.
- Create exclusions for certain users, for example those used by Ansible scripts.
- Easily customize the message with your own logo.
Example of an email alert with an unauthorized IP address.




