Archive for April, 2015
alert on email when someone login to linux system
Security is now a days becoming hot topic and making server system secure is challenging job for system and security engineers. Here is the steps on how to get email alert when someone login to system and get shell access.
You have to clear for which user you want to get alert. Here i am doing for root
1) Open .bashrc in root folder
#vi /root/.bashrc
2) Append following lineĀ at last
echo ‘ALERT – Root Shell Access on yourservername on:’ `date` `who` | mail -s “Alert: Root Access from `who | cut -d'(‘ -f2 | cut -d’)’ -f1`” amirtoamir@gmail.com
Logout and check again by logging in. By this time, you have to get mail on your email.
Thanks for reading