Get an email everytime someone logs in as root

Simply edit the .bash_profile in the users directory (in this case "root") by...

1. Make sure you are logged in as root (e.g. su -)
2. Change to roots home directory by typing "cd" (only cd, nothing else, e.g. no further slash!)
3. Edit your bash profile by typing "pico .bash_profile "
4. At the end of the file add the following line:

echo 'ALERT - root access on: ' `date` `who` | mail -s "ALERT: root access on server SERVERNAME"

Be sure to replace SERVERNAME with the name of your server (important if you have more than one) and to replace "" with your email address - preferrable an off-server email address.

  • August 2005

    Participate in our new forum!
  • Easy tutorials!

    Take a look at our webhosting tutorials - step by step explanations.
    Read More
  • Strange technical expressions?

    Come and see our dictionary!
    Read More
    Home   l   Tutorials   l  Articles   l  LINUX help   l  Dictionary   l  Forum   l  Resources   l  Contact

    Copyright ® 2003-2005
    Webhosting provided by