Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2002
    Location
    Las Vegas
    Posts
    797

    * E-mail Alert on Root SSH Login but also all ssh users too ?

    like this help file
    http://www.webhostgear.com/43.html

    but working on all ssh users not just root

  2. #2
    Join Date
    Jul 2001
    Location
    Singapore
    Posts
    1,790
    You mean you want to get alerted if anyone login? If so, you might want to take a look in this file /etc/bashrc which end of the file is something like below:
    Code:
    if ! shopt -q login_shell ; then # We're not a login shell
            for i in /etc/profile.d/*.sh; do
                if [ -r "$i" ]; then
                    . $i
                fi
            done
            unset i
    else
            # Send alert to server admin
            echo 'ALERT - Shell Access on:' `date` `who` | mail -s "Alert: Shell Access on Server `hostname` from `who | awk '{print $6}'`" root
    fi
    Giam Teck Choon
    :: Join choon.net Community today to share your tips and tricks on server issues please ::
    :: Singapore Dedicated Servers :: Singapore Virtual Private Servers :: Linux/FreeBSD Server Management ::

  3. #3
    Try out LogWatch, it will give you a daily detailed report on who has accessed ssh and who failed to access ssh.
    FrogJumper.com, Superb Cpanel Web Hosting.
    Excellent, High Paying Affiliate Program.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •