Get an email when somebody connects to ssh.
This script is called by
sshrc file and send an email notification every time
somebody make a successful connection by SSH.
How it works
ssh-notify writes an entry in a log file every time someone make a successful connection by SSH then it sends an email. In the config file, you can set a period of time to avoid receiving multiple times the same email. For example, if the last connection is less than 1 hour, you will not reveive another email.
- Download the last version of ssh-notify here
dpkg -i ssh-notify-X.X.X.deb
- Clone this repository:
git clone https://github.com/pruje/ssh-notify
- Update submodules:
git submodule update --init
- Add all users you want to monitor in
- (optionnal) If you want to secure access to the log file, you can enable the sudo mode in config
then add the following line in
%ssh-notify ALL = NOPASSWD:/path/to/ssh-notify/ssh-notify.sh
apt remove ssh-notify
ssh-notify is licensed under the MIT License. See LICENSE.md for the full license text.
Author: Jean Prunneaux https://jean.prunneaux.com
Source code: https://github.com/pruje/ssh-notify
Report a bug or request for a feature here.