Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Results 1 to 1 of 1
  1. #1
    Member
    Join Date
    Feb 2004
    Location
    India
    Posts
    39

    Default Mail alert when someone logs into your SSH

    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
    Last edited by d4rkl0rd; 12-22-2004 at 04:29 AM.

Similar Threads & Tags
Similar threads

  1. SSH Logs
    By katamiaw in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 05-02-2010, 10:18 AM
  2. E-mail Alert on Root SSH Login
    By crazyaboutlinux in forum New User Questions
    Replies: 6
    Last Post: 06-09-2009, 06:42 AM
  3. Alert everytime someone logs into WHM?
    By bls24 in forum New User Questions
    Replies: 1
    Last Post: 07-11-2008, 10:39 AM
  4. Question about raw access logs in SSH
    By JMusic in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 04-20-2007, 04:28 PM
  5. SSH Logs
    By webbhost in forum cPanel and WHM Discussions
    Replies: 9
    Last Post: 01-08-2005, 11:33 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube