Another way to improve the security of your linux server is to enable server to automatically send a notification email to predefined email address everytime someone logs in as root to the host.
Procedures
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 nano or vi by typing one of the following commands at command shell line:
[root@myserver ~]# nano .bash_profile or [root@myserver ~]# 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 Access from `who | cut -d"(" -f2 | cut -d")" -f1`" burnz@mydomain.com
var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-37138722-1']); _gaq.push(['_trackPageview']);
(function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })();