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.

ssh email notification

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

  1. Sheldon

    Sheldon Well-Known Member

    Joined:
    Jun 7, 2004
    Messages:
    378
    Likes Received:
    0
    Trophy Points:
    16
    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
     
  2. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    /etc/profile is probably what you want.
     
  3. Sheldon

    Sheldon Well-Known Member

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

    -bash: /bin/mail: Permission denied

    for all users not root
     
  4. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    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.
     
  5. Sheldon

    Sheldon Well-Known Member

    Joined:
    Jun 7, 2004
    Messages:
    378
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Canada
    explain.. (exim sendmail) method
     
  6. Sheldon

    Sheldon Well-Known Member

    Joined:
    Jun 7, 2004
    Messages:
    378
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Canada
    *bump*
     
  7. mjm2

    mjm2 Well-Known Member

    Joined:
    Oct 3, 2003
    Messages:
    52
    Likes Received:
    0
    Trophy Points:
    6
    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:
    16
    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.
     
Loading...

Share This Page