The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Mail alert when someone logs into your SSH

Discussion in 'E-mail Discussions' started by d4rkl0rd, Jul 10, 2004.

  1. d4rkl0rd

    d4rkl0rd Active Member

    Joined:
    Feb 23, 2004
    Messages:
    39
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    India
    vi /root/.bash_profile

    echo 'ALERT - Root Shell Access (YourserverName) on:' `date` `who` | mail -s "Alert: Root Access from `who | cut -d"(" -f2 | cut -d")" -f1`" you@yourdomain.com

    or

    echo 'ALERT - Root Shell Access on:' `date` `who` | mail -s "Alert: Root Access from `who | awk '{print $6}'`" youremail@yourmailaddress.com

    Make sure that the e-mail address you use is not hosted on the server

    Andrew Arumaithambi :D
     
    #1 d4rkl0rd, Jul 10, 2004
    Last edited: Dec 22, 2004
Loading...

Share This Page