One-liner to mail when someone logs in as root
This is a short post describing how to automatically send an email every time someone logs in as root on a linux server. Add the following line to /root/.bash_profile if you are using bash as your default shell interpreter. Refer to /etc/passwd. (echo “Subject: ALERT: servername Root Shell Access from `who | awk ‘{print $5}’`”; […]