Announcement

Collapse
No announcement yet.

Root login alert via email

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Root login alert via email

    If you want to receive an email every time when someone login into SSH as root, edit .bash_profile (It's located in /root directory) and put this at the end of file:

    =========
    echo 'ALERT - Root Shell Access on:' `date` `who` | mail -s "Alert: Root Access from `who | awk '{print $6}'`" [email protected]
    =========

    If you want to set message on login to ssh, edit /etc/motd, write in motd something like this:

    =========
    "ALERT! This is a secured area. Your IP is logged. Administrator has been notified"
    =========
    When someone logins into SSH he/she will see that message.
Working...
X