Script to send email for every root logins in linux 1.cd /root 2 nano .bashrc 3. Scroll to the end of the file then add the following: echo 'ALERT - Root Shell Access (YourserverName) on:' `date` `who` | mail -s "Alert: Root Access from `who | cut -d"(" -f2 | cut -d")" -f1`"yourname@gmail.com Replace gmail with the handle for your actual server Replace you@yourdomain.com with your actual email address 4. CTRL+x Y now log in as root u should get the email to check the status of mail in the linux type mailq tail -n 50 /var/log/maillog