Go Back   Singapore Web Hosting Talk > LEARNING CENTER > Server Administration

Server Administration General dedicated servers administration topics.

Reply
 
Thread Tools
Old 29-07-2004, 22:08   #1
shawnho
SGWHT Premium Member
 
Join Date: 24-07-2003
Location: Singapore
Posts: 1,541
shawnho is a jewel in the roughshawnho is a jewel in the roughshawnho is a jewel in the roughshawnho is a jewel in the rough
HOWTO - Get email notice whenever someone gain root access to your server

If your root account default shell is bash, add the following at the end of the file /root/.bash_profile:
Code:
   
# Send alert to server admin

echo 'ALERT - Root Shell Access on:' `date` `who` | mail -s "Alert: Root Access on Server `hostname` from `who | awk '{print $6}'`" your_full_email_address_here
I would personally use an email address which is not hosted in that server.

That's all

Thanks.



HOWTO courtesy of Choon
shawnho is offline   Reply With Quote

Old 18-03-2008, 17:36   #2
memoriess
SGWHT Newbie
 
Join Date: 03-09-2006
Posts: 50
memoriess is on a distinguished road
Hi, just to ask if there is anyway to monitor an account user logging alert via ssh too?
__________________
CozyHome
memoriess is offline   Reply With Quote
Old 18-03-2008, 19:09   #3
choon
SGWHT Senior Member
 
Join Date: 01-07-2002
Location: Singapore
Posts: 488
choon has a spectacular aura aboutchoon has a spectacular aura about
You should be able to by adding the above alert to user's .bash_profile file if bash is the user default shell. Hope this helps ;)

Something like:
Code:
echo 'ALERT - User Shell Access on:' `date` `who` | mail -s "Alert: User Shell Access on Server `hostname` from `who | awk '{print $6}'`" your_full_email_address_here
__________________
Giam Teck Choon
System Administrator
Join my community today at choon.NET Community to share server related tips and tricks!
External/One-Year WHM/cPanel licenses | Linux/FreeBSD Server Management | Xen VPS Solutions (with/without WHM/cPanel or DirectAdmin)
choon is offline   Reply With Quote
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump




All times are GMT +8. The time now is 11:57.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright (C) 2002-2015 Brought to you by Singapore Web Hosting Talk (SGWHT). All Rights Reserved.