blog:send_email_on_root_login
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
blog:send_email_on_root_login [2009-07-02 06:52] – created 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. | ||
Line 10: | Line 10: | ||
Example: | Example: | ||
- | ALERT - Root Shell Access on: Tue Jun 30 20:06:40 MDT 2009, | + | |
- | | + | nixtutor |
Source: http:// | Source: http:// |
blog/send_email_on_root_login.1246510361.txt.gz · Last modified: 2009-07-02 06:52 by brb