choon
10-08-2003, 03:47 AM
If your root account default shell is bash, add the following at the end of the file /root/.bash_profile:
# Send alert to server admin
echo 'ALERT - Root Shell Access on:' `date` `who` | mail -s "Alert: Root Access on Server `hostname` from `who | awk '{print $6}'`" your_full_email_address_here
I would personally use an email address which is not hosted in that server.
That's all :)
Thanks.
# Send alert to server admin
echo 'ALERT - Root Shell Access on:' `date` `who` | mail -s "Alert: Root Access on Server `hostname` from `who | awk '{print $6}'`" your_full_email_address_here
I would personally use an email address which is not hosted in that server.
That's all :)
Thanks.