Knowledgebase


Portal Home > Knowledgebase > Linux > Security > How to get email alert for SSH root login ?


How to get email alert for SSH root login ?




Get Email alert on ssh root login

1. Login to your server as root user

2. Open file '.bash_profile'
   
    root#rbdc:~ vi .bash_profile


3. Add following lines in script..

   echo 'ALERT - Root Shell Access on:' `date` `who` | mail -s "Alert: Root Access from `who | awk '{print $6}'`" mail@mailaddress.com


Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
How to use iptables? (Views: 4310)

Language: