- SSH server as root user
- yum install mailx
- cd /root
- vi .bashrc
Copy the line below and paste it at the end.
- echo 'ALERT - Root Shell Access on (server.hostname.com) on:' `date` from `who` | mail -s "Alert: Root Access from `who | cut -d'(' -f2 | cut -d')' -f1`" contact@dexterserver.com
- Save and exit
Now whenever any body will login as root user in the server you will get the email alert with the IP from which login was made.
No comments:
Post a Comment
Do Write about the Blog and Welcome to the world where open source is every thing :-)