A script to notify you when others login your server via ssh.
wget -N --no-check-certificate https://raw.githubusercontent.com/Green-m/sshnotify/master/install.sh && chmod +x install.sh && bash install.sh
vim /etc/sshnotify/whitelist.config
white_user=(root test)
white_ip=(1.1.1.1 8.8.8.8)
That sshnotify would send notification except these situations below:
-
The login user is
root
ortest
-
The ip login from is
1.1.1.1
or8.8.8.8
vim /etc/sshnotify/whitelist.config
[email protected]
sendmailpass=xxxxxxxx
mailserver=smtp.gmail.com:587
[email protected]
Notice: After any config changed, run service sshnotify restart
to reload.
Verbose log is locate /var/log/sshnotify/sshnotify.log