Setup root login email alerts in Linux servers

If our website helped you then please click on any of the ads on this page to support us. Your support will help us to create more and more useful posts.

 

In order to receive alerts to your email accounts please follow the steps given below.

Step 1: Login to the server as root

Step 2: Open the file .bash_profile file and append the command given below script below

echo ‘ALERT – Root Shell Access (root@IP ADDRESS) on:’ `date` `who` | mail -s “Alert: Root Access from `who | cut -d”(” -f2 | cut -d”)” -f1`” xyz@gmail.com

Step 3: Save and exit

Step 4: Login to the server again and check the mail account. Please check your spam mails also.

Please change the email address xyz@gmail.com with your mail address to where you wants to receive alerts.

 

If our website helped you then please click on any of the ads on this page to support us. Your support will help us to create more and more useful posts.

Leave a Reply

Your email address will not be published. Required fields are marked *

nine + thirteen =