Saturday, August 17, 2013

e-mail alert for every root logins

get email for every root logins


1.cd /root
3. nano .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`"yourname@gmail.com

Replace gmail with the handle for your actual server
Replace you@yourdomain.com with your actual email address

5. CTRL+x Y

now log in as root u should get the email
to check the status of mail in the linux type mailq
tail -n 50 /var/log/maillog

1 comment:

  1. Dear Sir,
    i have use goautodail dialer,i need your help meetme conference bridge.pls give me your contact no.

    My contact no -9818513209

    ReplyDelete