blog:send_email_on_root_login
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
blog:send_email_on_root_login [2009-07-02 06:52] – brb | blog:send_email_on_root_login [2009-07-02 07:09] (current) – brb | ||
---|---|---|---|
Line 4: | Line 4: | ||
Login as root and edit the file, ‘~/ | Login as root and edit the file, ‘~/ | ||
- | echo -e “Subject: Root Access\n\nALERT – Root Shell Access on: `date`, `who`\n” | ssmtp user@domain.com | + | echo -e “Subject: Root Access\n\nALERT – Root Shell Access on: `date`, `who`\n” | mail -s "Root access" |
Now to test it, log out of root and then log back on as root. You should now get an alert that someone has logged in as root. This script shows the time and user. You can adjust the information accordingly depending on how detailed you want it. | Now to test it, log out of root and then log back on as root. You should now get an alert that someone has logged in as root. This script shows the time and user. You can adjust the information accordingly depending on how detailed you want it. |
blog/send_email_on_root_login.1246510373.txt.gz · Last modified: 2009-07-02 06:52 by brb