Alert message when someone login as root via SSH
« on: April 24, 2008, 01:15:58 AM »
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}'`" yourname@domain.com
« Last Edit: January 01, 1970, 05:30:00 AM by Kailash »