Re: Passwd Change -> Email

From: Bandi (05.08@web.de)
Date: 09/02/01


Date: Sun, 2 Sep 2001 17:53:15 +0200 (CEST)
From: Bandi <05.08@web.de>
To: Administrator <lists@digitalplace.org>
Subject: Re: Passwd Change -> Email
Message-ID: <Pine.LNX.4.21.0109021534540.1367-100000@ikarus.not.mil>


> 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.

Michael,

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.

#!/bin/sh

/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

#EOF

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.
Bandi



Relevant Pages

  • Re: Automating password change
    ... script to find and replace the line on all the systems. ... >> to change passwords on every month for my account and for an application ... >> to write a simple script to wrap around passwd that would run on each ... >> to a TCL library or libraries. ...
    (comp.unix.solaris)
  • Re: Automating password change
    ... script to find and replace the line on all the systems. ... >> to change passwords on every month for my account and for an application ... >> to write a simple script to wrap around passwd that would run on each ... >> to a TCL library or libraries. ...
    (comp.unix.shell)
  • RE: Using kerberos with users in passwd
    ... We have RHEL5 with krb5 and a script-generated /etc/passwd file. ... native passwd command much in our future. ... Active Directory via script. ... HP-UX there is a PAM module which uses a file pam_users.conf. ...
    (comp.protocols.kerberos)
  • Re: Hi
    ... Ekta Sachdeva writes: ... perform all this crap work .... ... and, presumably, you can put eight of these into a script. ... Some versions of passwd may ...
    (comp.unix.shell)
  • Re: Setting passwords in remote systems
    ... I install expect in my Solaris system, and now I can change user´s ... spawn passwd ... Only if you tell us how you manage to connect to the remote systems! ... The basic idea is that you write an expect script that connects to the ...
    (comp.unix.shell)