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 to protect server from Brute Force Attacks?

Here are a few of the many security options the WHM/cPanel has built in to protect your cPanel...

What is SSH and its basic useful commands?

SSH or Secure Shell is a way to manage a dedicated server remotely by using integrated Linux...

How to use iptables?

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

How can I block a IP address?

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

How to install rkhunter ?

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