This guide is to improve the security of the server, which is exposed to the Internet and possible to get hacked worldwide, it’s best to enable server to automatically send a notification email to predefined email address every time someone logs in as root to the host. To configure the automatic email alert notification to a default email address on each incident of root log on on the server, use the following guide.
  1. Login to the server via SSH using as root ID.
  2. Ensure that you’re at home directory of root. The open up the .bash_profile for editing using vi by typing one of the following commands at command shell line:vi .bash_profile
  3. Scroll down to the end of the file and add the following line:
    echo 'ALERT - Root Shell Access on:' `date` `who` | mail -s "Alert: Root...