Mail alert for ssh login
To get a mail when some logged into your linux system then follow this steps
Edit .bashrc in root folder /root
[shell]
vi .bashrc
[/shell]
Add following line at end of the file
[shell]
echo 'ALERT - Root Shell Access (server name) on:' `date`
`who` | mail -s "Alert: Root Access from `who | cut -d"(" -f2 | cut -d")"
-f1`" yourmail@gmail.com[/shell]