From: jim on
In the shadow file which has the format of:

username:password:lastchg:min:max:warn:inactive:expire:flag

if the 'lastchg' field has a '0' in it for a user, does that mean that
this user has never logged in or does it mean this account is set to
never have to change the password

For example:

username:qTBsrXfdWZVZE:0:7:84:7:::

Could someone help clarify this?

Thanks

jim
From: Dave on
jim wrote:
> In the shadow file which has the format of:
>
> username:password:lastchg:min:max:warn:inactive:expire:flag
>
> if the 'lastchg' field has a '0' in it for a user, does that mean that
> this user has never logged in or does it mean this account is set to
> never have to change the password
>
> For example:
>
> username:qTBsrXfdWZVZE:0:7:84:7:::
>
> Could someone help clarify this?
>
> Thanks
>
> jim

I do not know for sure, but I'd very surprised if the process of logging in
causes a write to the password file. So I doubt the '0' means he has never
logged in.

I would just create an account or two and test if I wanted to know. Or of course
look at the OpenSolaris source code.
From: nelson on
the manual page states:
lastchg The number of days between January 1, 1970,
and the date that the password was last
modified. The lastchg value is a decimal
number, as interpreted by atol(3C).

so i don't think it means anything about whether the user has logged
in or
not (isn't that what utmpx/wtmpx is for?). the manual page goes on
further
to say that:
"A value of -1 for min, max, or warn disables password aging"

to be honest i don't know why they'd be a 0 ni the lastchg field, i
had a quick
poke around a couple of boxes and they either have an empty field or
something in the tens of thousands range...
From: Richard L. Hamilton on
In article <d33dd14a-e4f5-475d-bfd3-061c0460bf36(a)r24g2000yqd.googlegroups.com>,
jim <jim.kong(a)gmail.com> writes:
> In the shadow file which has the format of:
>
> username:password:lastchg:min:max:warn:inactive:expire:flag
>
> if the 'lastchg' field has a '0' in it for a user, does that mean that
> this user has never logged in or does it mean this account is set to
> never have to change the password
>
> For example:
>
> username:qTBsrXfdWZVZE:0:7:84:7:::
>
> Could someone help clarify this?
>
I would tend to think that in that example, they hadn't logged in,
because max is set, and 0 is clearly way too low. So I would think
they'd have to have changed the password at first login, and didn't,
and therefore haven't logged in.

Today's date in the same terms as lastchg can be seen with

perl -e 'printf "%d\n",int(time/(24*60*60));'

From: Darren Dunham on
On Nov 3, 9:45 am, jim <jim.k...(a)gmail.com> wrote:
> In the shadow file which has the format of:
>
> username:password:lastchg:min:max:warn:inactive:expire:flag
>
> if the 'lastchg' field has a '0' in it for a user, does that mean that
> this user has never logged in or does it mean this account is set to
> never have to change the password

I believe '0' means "user much change password on next login". "never
has to change" would be equivalent to no "max" field, yes?

--
Darren