*BSD News Article 82995


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!news.ecn.uoknor.edu!feed1.news.erols.com!howland.erols.net!EU.net!usenet2.news.uk.psi.net!uknet!usenet1.news.uk.psi.net!uknet!dispatch.news.demon.net!demon!xciv.demon.co.uk!usenet
From: paul@xciv.org (Paul Civati)
Newsgroups: comp.unix.bsd.netbsd.misc
Subject: Re: Passwd Expire'ing
Date: 16 Nov 1996 18:03:18 GMT
Organization: XCIV
Lines: 51
Message-ID: <56kvl7$7l@xciv.demon.co.uk>
References: <847976274.19159.0@kevinw.noc.demon.net>
Reply-To: paul@xciv.org
NNTP-Posting-Host: pantera.xciv.org
X-NNTP-Posting-Host: xciv.demon.co.uk
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Newsreader: knews 0.9.8

In article <847976274.19159.0@kevinw.noc.demon.net>,
	kevinw@kevinw.demon.net (Kevin Walton) writes:

> Im trying to get the password expire stuff to work on netbsd 1.2,
> I have put an entry in my password file -> 
> 
> kevin:XXXXXXX:500:20:Jan011995:0:0:Kevin Walton:/home/kevin:/bin/csh
> 
> And you can see a password expire time of Jan 01, 1995, but when I login
> it doesnt force me to use a new passwd?
> I have tried a few differnt formats in the line.

From the man page, passwd(5):

           name      User's login name.
           password  User's encrypted password.
           uid       User's id.
           gid       User's login group id.
           class     User's general classification (unused).
           change    Password change time.
           expire    Account expiration time.
           gecos     General information about the user.
           home_dir  User's home directory.
           shell     User's login shell.

[..snip..]

  The class field is currently unused.  In the near future it will be a key
  to a termcap(5) style database of user attributes.

  The change field is the number in seconds, GMT, from the epoch, until the
  password for the account must be changed.  This field may be left empty
  to turn off the password aging feature.

  The expire field is the number in seconds, GMT, from the epoch, until the
  account expires.  This field may be left empty to turn off the account
  aging feature.

I've no idea what 'from the epoch' means but since most specifications
of time in seconds are since 01 Jan 1970 00:00:00 I will guess that's
what it means. :)

Now, how to generate such values for your /etc/passwd, I dunno.  I've
done it before, I had to write some (not very good) code to do it, gets
difficult when you have to take the various leap year rules into account.

-Paul-

-- 
Paul Civati  =O=  Home: paul@xciv.org          =O=  http://www.xciv.org/
London UK    =O=  Home: paul@xciv.demon.co.uk  =O=  Slackware is.