Home   Help Login Register  
Welcome, Guest. Please login or register.

Login with username, password and session length

Search
Pages: [1]
Print
Topic: Email when someone logs into your server with root privileges  (Read 736 times)
0 Members and 2 Guests are viewing this topic.
« on: March 15, 2010, 09:27:38 PM »
Scott
Jr. Member

View Profile Email
**
Posts: 51



Edit .bashrc which if found under the /root partition & insert the following line anywhere in between:

Code:
echo 'SSH Root Access (Your Server Name) on:' `date` `who` | mail -s "ALERT: Root Access from
who | cut -d"(" -f2 | cut -d")" -f1`" your@email-address.com

save & close the file & that's all. Now, whenever someone successfully logs in to your server as root through SSH, an email will be automatically dispatched from the server to the mentioned mail address.

Thanks!
Logged
Pages: [1]
Print
Jump to:  

� 2006 VPS forum, VPS hosting forums, VPS discussions, VPS web hosting solutions, issues, providers, virtual web hosting questions, VPS hosting
Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC | Forum style designed by PixelSlot
| Sitemap - XML Sitemap