To setup email notification, login to your server as root.
add the following line at the end, changing
"ServerName" to the host-name of your server and
"firstname.lastname@example.org" to your own email address.
echo 'ALERT - Root Shell Access (Server-name) on:' `date` `who` | mail -s "Alert: Root Access from `who | cut -d"(" -f2 | cut -d")" -f1`" email@example.com
Save and exit.
Next time someone (hopefully you) logs on as root, you will get an email about this.
Subscribe to Today I learned
Get the latest posts delivered right to your inbox