• Welcome to Web Hosting Community Forum for Webmasters - Web hosting Forum.
 

Recommended Providers

Fully Managed WordPress Hosting
lc_banner_leadgen_3
Fully Managed WordPress Hosting

WordPress Theme

Divi WordPress Theme
WPZOOM

Forum Membership

Forum Membership

Alert message when someone login as root via SSH

Started by Kailash, April 24, 2008, 01:15:58 AM

Kailash

Hi,

You can set the alert when someone login as root on your server via SSH. Server will email you

each time when someone login as root. To accomplish this you will need to edit the file .bash_profile.

At command prompt type the below command:

pico .bash_profile

At the end of the file add following code:

echo 'ALERT - Root Access from:' `date` `who` | mail -s "Alert: Root Access from `who | awk '{print $6}'`" mailto:[email protected]">[email protected]