Being *Smart* with the shadow file ???
From: Spook (spectre_at_xtra.co.nz)
Date: 07/06/05
- Next message: Bill Wyatt: "Re: checking if a directory is empty"
- Previous message: Chris F.A. Johnson: "Re: splitting a variable"
- Next in thread: Logan Shaw: "Re: Being *Smart* with the shadow file ???"
- Reply: Logan Shaw: "Re: Being *Smart* with the shadow file ???"
- Reply: __jakal__: "Re: Being *Smart* with the shadow file ???"
- Reply: Logan Shaw: "Re: Being *Smart* with the shadow file ???"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 5 Jul 2005 18:20:23 -0700
Hello All,
It's late in the day and my mind is weary...
I'm trying to write a script to calculate that a user's password is
about to expire in 3 days and the script that will run daily will do a
`passwd -f $userid` so that when s/he logs in the next day s/he will be
forced to change password.
Reason I'm doing this is that currently the users get sent directly to
a Oracle FORMS menu dictated by their .profile when they login. They do
not even see the $>prompt to change password.
So now I see that the third entry (lastchg) in the /etc/shadow file
pertains to when the user last changed their passwd from UNIX epoch of
January 1, 1970.
Now this is making my head spin on how I'm going to write a shell
script to calculate the date stamp on the shadow file and the current
date.
My initial plan was to extract the userid and date from the `passwd
-sa` and some how compare todays date and the last change + 3 months
date.
testuser PS 07/05/05 90 70
Example: I would set variable $A = the last change date 07/05/05 and
add 3 months as required... so the month of 07 to 10 .
A="10/05/05"
B=`date '+%D'`
So now ...
If [ $A == $B ]; then
passwd -f $userid
fi
Well that's my current plan...but I still think trying to figure out
how to calculate using UNIX epoch would be the way to go...
Thanks in advance...
- Next message: Bill Wyatt: "Re: checking if a directory is empty"
- Previous message: Chris F.A. Johnson: "Re: splitting a variable"
- Next in thread: Logan Shaw: "Re: Being *Smart* with the shadow file ???"
- Reply: Logan Shaw: "Re: Being *Smart* with the shadow file ???"
- Reply: __jakal__: "Re: Being *Smart* with the shadow file ???"
- Reply: Logan Shaw: "Re: Being *Smart* with the shadow file ???"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|