WARNING: According to eApps policy if you edit any system files manually, they might not support the changes you have made. Use at your own risk.
1. Login to your server and su to root, I know the irony!
2. cd /root
3. nano .bashrc
4. Scroll to the end of the file then add the following:
echo 'ALERT - Root Shell Access (YourserverName) on:' `date` `who` | mail -s "Alert: Root Access from `who | cut -d"(" -f2 | cut -d")" -f1`"you@yourdomain.com
Replace YourServerName with the handle for your actual server
Replace you@yourdomain.com with your actual email address
5. Crtl + X then Y
Now logout of SSH, close the connection and log back in! You should receive an email address of the root login alert a few minutes afterwards.
Cheers!!!!
No comments:
Post a Comment