Saturday, 28 March 2015

Enable root login alert . Send mail alert when anyone login server

1. Login to your server
2. cd /root
3. pico .bashrc
4. 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`" test123@gmail.com

No comments:

Post a Comment