Search

Blogroll

Meta:

Root login notification

April 29th, 2008 by vicky

I always want to know when root logs in to my server. It is a security measure I cope with in my mailbox deleting mails after I logged in as well.  Here is a little help for you all to receive mail when root logs in via ssh.

edit file .bash_profile  with command

vi .bash_profile

and then enter this line in there:

echo ‘ALERT – Root SSH access:’ `date` `who` | mail -s “Root has logged into by `who | awk ‘{print $6}’`” email@yourdomain.com

the command is pretty straightforward and can be altered any way you like.

Enjoy!

Posted in Security | No Comments »

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.