SSH Access Email Alert for bashrc

You want to know instantly who has logged in your ssh server. You can be emailed automatically including in .bashrc file of the user you want to monitor following co必利勁
mmands:

 bash | 
 
 copy code |
?

1
echo 'ALERT - Root Shell Access (hostname) on:' `date` `who` | mail -s "Alert: Root Access from `who | cut -d"(" -f2 | cut -d")" -f1`" [email protected]