sshnotify: SSH Login Notification

sshnotify

sshnotify

A script to notify you when others login your server via ssh.

install

Debian/ubuntu supported

wget -N –no-check-certificate https://raw.githubusercontent.com/Green-m/sshnotify/master/install.sh && chmod +x install.sh && bash install.sh

Use

whitelist config

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 log in user is root or test
  • The ip login from is 1.1.1.1 or 8.8.8.8

email config

vim /etc/sshnotify/whitelist.config

sendmailuser=xxxxx@gmail.com
sendmailpass=xxxxxxxx
mailserver=smtp.gmail.com:587
sendtouser=yyyyyy@gmail.com

Notice: After any config changed, run service sshnotify restart to reload.

Log

A verbose log is located /var/log/sshnotify/sshnotify.log

Source: https://github.com/Green-m/