Archive for April, 2015

alert on email when someone login to linux system

Security is now a days becoming hot topic and making server system secure is challenging job for system and security engineers. Here is the steps on how to get email alert when someone login to system and get shell access.

You have to clear for which user you want to get alert. Here i am doing for root

1) Open .bashrc in root folder

#vi /root/.bashrc

2) Append following lineĀ  at last

echo ‘ALERT – Root Shell Access on yourservername on:’ `date` `who` | mail -s “Alert: Root Access from `who | cut -d'(‘ -f2 | cut -d’)’ -f1`” amirtoamir@gmail.com

Logout and check again by logging in. By this time, you have to get mail on your email.

Thanks for reading

//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js //

April 22, 2015 at 9:49 am Leave a comment


About Me

Categories

April 2015
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
27282930  

Blog Stats

  • 30,395 hits