How to get email alert for SSH root login ?

Get Email alert on ssh root login

1. Login to your server as root user

2. Open file '.bash_profile'
    root#rbdc:~ vi .bash_profile

3. Add following lines in script..

   echo 'ALERT - Root Shell Access on:' `date` `who` | mail -s "Alert: Root Access from `who | awk '{print $6}'`" [email protected]
  • 69 Users Found This Useful
Was this answer helpful?

Related Articles

How can I block a IP address?

To block an individual IP address from accessing your Linux server, you can use the following...

How can I reset my root password?

This article explains how to reset your server root password if you no longer know it. You will...

How to use iptables?

Warning Modifying rules on your server can cause the server to become inaccessible on port 22...

How to install rkhunter ?

Rootkit Hunter Rootkit scanner is scanning tool to ensure you for about 99.9%* you're clean of...

How to install syslog server ?

Syslog Features : 1. Logs the daemon information to Remote host2. Logs the daemon information to...