The script makes sure that you are notified by email about every user login via SSH.
The script ssh-login-notification.sh
only needs to be placed under /etc/profile.d/
so that it is executed every time the user logs on via SSH.
If not already installed, the dnsutils
and mailutils
packages are needed to resolve IP to FQDN and send emails. It is assumed that a working MTA like Exim is installed.
The script need to be customized. All that is required is to create a file with the name ssh-login-notification.conf
.
Please configure the following settings:
Setting | Description |
---|---|
MESSAGE | A message that describes what happened. |
RECEIVER | Any valid email address. |
SUBJECT | A meaningful email subject. |
MESSAGE="An SSH login was detected."
RECEIVER="example@example.com"
SUBJECT="SSH Login"
Please note the changelog to check for configuration changes before updating.
This project is licensed under the MIT - see LICENSE.md file for details.
*[MTA]: Mail Transport Agent *[SSH]: Secure Shell