Web Hosting Forums Web Discussions on Hosting Webmaster forums Web Hosting Forums Domain Name Forums Web Hosting

Old 08-29-2005, 09:14 PM   #1 (permalink)
Hosting Master
Join Date: Aug 2005
Location: New Delhi,India
Posts: 250
incript_services is on a distinguished road
E-mail Alert on Root SSH Login

Want to be notified instantly when someone logs into your server as root? No problem, check out this nice tutorial on email notification for root logins. Keeping track of who logs into your server and when is very important, especially when you're dealing with the super user account. We recommend that you use an email address not hosted on the server your sending the alert from.

So lets get started!

1. Login to your server and su to root, I know the irony!

2. cd /root

3. pico .bashrc

4. Scroll to the end of the file then add the following:
echo 'ALERT - Root Shell Access (YourserverName) on:' `date` `who` | mail -s "Alert: Root Access from `who | cut -d"(" -f2 | cut -d")" -f1`" you@yourdomain.com

Replace YourServerName with the handle for your actual server
Replace you@yourdomain.com with your actual email address

5. Crtl + X then Y

Now logout of SSH, close the connection and log back in! You should receive an email address of the root login alert a few minutes afterwards.

Note: This is a great tool for servers that have multiple admins or if you give someone SSH access for whatever reason, although you should give out the root password to as few people as humanly possible and be sure to change it often.

This will not magically alert you when a hacker runs the latest kernel exploit on your server and logs into SSH because they will create their own SSH/telnet connection. You should keep your system up to date, install a firewall and follow the latest security releases.
__________________
(Red Pepper)A Microsoft Products Blog with other Technology Updates.
incript_services is offline  
profile.gif home.gif sendpm.gif find.gif Reply With Quote
Old Sponsored Ads   # a.
Ads
Hosting Master
Join Date: Feb 2006
Location: HWHT
Posts: 1100
Ads is on a distinguished road



This message will go away once you are registered. Also, by registering, you will have access to all post topics, communicate privately with other members (PM), respond to polls, upload graphics, and access other special features! Registration is fast, simple and absolutely free so please Click Here to join our Web Hosting community today!
AdsPromoter is online
profile.gif sendpm.gif email.gif find.gif buddy.gif Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Security for root server technofy_kiran Technical & Security Issues 4 08-23-2006 10:28 AM
PHP BB Exploit Alert john_robot Technical & Security Issues 1 12-14-2005 02:42 AM
Login System (Help) wajahat_mehdi88 Programming Discussion 9 09-24-2005 08:44 PM
Creating a Welcome message for SSH logins incript_services Dedicated Server Tutorials 0 08-29-2005 09:16 PM


All times are GMT. The time now is 09:17 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.