SSH Login Notification
Someone might say I’m paranoid but i like to now when someone logs into my server.
Copy this into the file “/etc/ssh/sshrc” (Ubuntu/Debian) and change “firstname.lastname@example.org” to your email address:
IP="$(echo $SSH_CONNECTION | cut -d " " -f 1)" HOST=$(hostname) echo ''$IP' logged into '$HOST'' | mutt -s 'SSH Login' email@example.com
This example only works if you have configured the Mutt email client.