Re: Passwd Change -> Email

From: Bandi (
Date: 09/02/01

Date: Sun, 2 Sep 2001 17:53:15 +0200 (CEST)
From: Bandi <>
To: Administrator <>
Subject: Re: Passwd Change -> Email
Message-ID: <>

> I am wondering if anyone has a program that will set a linux computer to
> email to a specified account when the passwd/shadow file changes. I
> have a linux box that I do not use everyday, and is a single hole in a
> firewall. The only port open is ssh and I want the box to email me if
> the password file changes. If anybody has an app that can do this I
> would be very appreciative. Thank you.


You could write a shell script for that. That's a pretty simple way and it
might not be very secure. You could too build your own passwd-application.


/usr/sbin/.passwd__ $@

if [`echo $?` -e 0]
echo -e "Hi!\nYour password has been changed on `date` maybe by yourself.\nBye!" |
mail `id -un` -s password-change


That one is a very simple example. If you fear someone could get root and
then change passwords, you have to use grep to get the user's name whose
password was changed (but if someone got root this way is really
insecure). In case that you use a script for your suppose you
need to change the name of the passwd-binary, put it to some directory
that is not readable by normal users + chmod the script 0711 so that
normal users can not see it is just a script.

I hope I could help!
Best regards.