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.

How can I get cpanel to send email on root login

Discussion in 'E-mail Discussions' started by wonker, Feb 3, 2009.

  1. wonker

    wonker Active Member

    Joined:
    Dec 5, 2007
    Messages:
    29
    Likes Received:
    2
    Trophy Points:
    3
    Hello,

    I've set up my servers to send me an e-mail when someone logs in as root to ssh, however I now would like them to send me an e-mail when someone logs in as root to whm.

    Is this possible ? if so how can I do this ? I've searched the forum but have not found an answer yet ...

    Thankyou !

    I would actually like to be able to send each user an email when they log into cpanel but this is less important than the whm root or reseller login
     
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Perhaps you could build a script that monitors /usr/local/cpanel/logs/access_log to determine when users login.
     
    #2 cPanelDavidG, Feb 3, 2009
    Last edited: Feb 3, 2009
  3. wonker

    wonker Active Member

    Joined:
    Dec 5, 2007
    Messages:
    29
    Likes Received:
    2
    Trophy Points:
    3
    Yes I could do this, however if I could add a script directly to cPanel Whm login this would be better ... to monitor /usr/local/cpanel/logs/access_log it would only tell me maybe 5 minutes afterwards and if someone managed to log in they could remove this easily ... the idea would be to get the email sent at the precise moment the person logs in ...

    More and more systems provide an automatic e-mail system like this and I'm a bit surprised that there is not an option in cpanel to do this or a file that you could modify to add a simple mail command on login to whm ...
     
  4. bluepine

    bluepine Active Member

    Joined:
    Dec 17, 2001
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    I am using ConfigServer's firewall, in particulare lfd; it tells you both failed and successfull login (I receive about 200 failed logins from China every day). The other nice thing, is that it can deny the IP after a number of failed logins.

    Of course you have to tune it a bit since it has thousands of features you are probably not interested into, but I think it's worth a try, awesome product indeed.
     
  5. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,453
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
  6. bluepine

    bluepine Active Member

    Joined:
    Dec 17, 2001
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    Actually it does :) You have to set:

    Code:
    # Send an email alert if anyone logs in successfully using SSH
    LF_SSH_EMAIL_ALERT = 1
    
    and you will receive email alerts for every successful logins.

    Cheers!
     
  7. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,453
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Actually, that's for log ins via SSH. Not logging in via WHM pass protection which I think is the point of the thread?
     
  8. bluepine

    bluepine Active Member

    Joined:
    Dec 17, 2001
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    Doh! You are right ;)
     
Loading...

Share This Page