Quantcast
Channel: SAM
Viewing all articles
Browse latest Browse all 10

mail alert for root login

$
0
0
Paste the below in either .bashrc or .bash_profile and restart your terminal


echo 'ALERT - Root Shell Access on:' `date` `who` | mail -s "Alert: Root Access from `who | cut -d"(" -f2 | cut -d")" -f1` to `/sbin/ifconfig | grep "inet addr" | head -1 | awk '{print $2}' | cut -d":" -f2`" user@examples.com


Viewing all articles
Browse latest Browse all 10

Trending Articles