How to setup an Email alert when somebody has logged into your server as root?

For receiving an alert if someone logs in as root to your server, you will have to make

Some changes to .bashrc that is available under the ‘/root’ partition.

This file is a hidden, therefore you must use the -a flag with ls command to view all the

hidden files.

Specify the below code to the bottom of the existing code;-

echo ‘SSH Root Access (Your Server Name) on:’ `date` `who` | mail -s “ALERT: Root Access    from `who | cut -d”(” -f2 | cut -d”)” -f1`” [email protected]

Then save and exit.

Its recommended not to enable root logins on SSH.

Also, it is useful to use an email address which isn’t hosted on the same server from

which the notifications would be sent.

  • 45 användare blev hjälpta av detta svar
Hjälpte svaret dig?

Relaterade artiklar

Can I use my domain name or must I use my IP address as the hostname for FTP?

Using your IP address (192.168.22.22  is an example IP address) is the preferred entry for...

Can you transfer my sites from my current host to my new VPS?

Yes. We will transfer all of your sites free* of charge and will assure that you experience no or...

Do you allow MP3 files? Do you allow streaming of videos?

Yes we do with our special plans at http://hostripples.in/avs-hosting.php

Do you support Cold Fusion?

We do not support or Cold Fusion on our shared hosting servers, however you are more than welcome...