Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

ssh email notification

Discussion in 'E-mail Discussion' started by Sheldon, Jul 2, 2004.

  1. Sheldon

    Sheldon Well-Known Member

    Joined:
    Jun 7, 2004
    Messages:
    378
    Likes Received:
    0
    Trophy Points:
    166
    Location:
    Canada
    Hi there,

    I use the following code to notify me when root logs in. So I know if someone else other than myself has gained access to root. Of course this script will also tell me if anyone else is logged in at the time. However it only executes when "root" logs in.

    I was wondering if anyone knew a way that I can have this script execute when ANYONE logs in via ssh. Without having to put this code into everyone(with ssh)'s .bash_profile file.

    The following is the code

    If anyone has any suggestions id apreciate it mucho.

    Thanks
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,460
    Likes Received:
    21
    Trophy Points:
    463
    Location:
    Go on, have a guess
    /etc/profile is probably what you want.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Sheldon

    Sheldon Well-Known Member

    Joined:
    Jun 7, 2004
    Messages:
    378
    Likes Received:
    0
    Trophy Points:
    166
    Location:
    Canada
    when I do that

    -bash: /bin/mail: Permission denied

    for all users not root
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,460
    Likes Received:
    21
    Trophy Points:
    463
    Location:
    Go on, have a guess
    Well, you can either CHMOD 755 /bin/mail or you can use sendmail (exim) from the command line instead.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. Sheldon

    Sheldon Well-Known Member

    Joined:
    Jun 7, 2004
    Messages:
    378
    Likes Received:
    0
    Trophy Points:
    166
    Location:
    Canada
    explain.. (exim sendmail) method
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. Sheldon

    Sheldon Well-Known Member

    Joined:
    Jun 7, 2004
    Messages:
    378
    Likes Received:
    0
    Trophy Points:
    166
    Location:
    Canada
    *bump*
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. mjm2

    mjm2 Well-Known Member

    Joined:
    Oct 3, 2003
    Messages:
    52
    Likes Received:
    0
    Trophy Points:
    156
    Location:
    rm -rf /
    have you tried searching google or anythinglike that?
     
  8. Sheldon

    Sheldon Well-Known Member

    Joined:
    Jun 7, 2004
    Messages:
    378
    Likes Received:
    0
    Trophy Points:
    166
    Location:
    Canada
    no i havent.. havent had time.. I normally look up the regarding documentation.... however ive just been extremely busy.

    so if anyone can help me out, greatly apreciated.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice