Skip site navigation (1)Skip section navigation (2)
Date:      22 May 2002 10:08:32 -0500
From:      Kirk Strauser <kirk@strauser.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: How to force one user to change his password?
Message-ID:  <873cwkte33.fsf@strauser.com>
In-Reply-To: <Pine.BSF.4.05.10205222211001.85542-100000@hoolan.org>
References:  <Pine.BSF.4.05.10205222211001.85542-100000@hoolan.org>

next in thread | previous in thread | raw e-mail | index | archive | help

At 2002-05-22T14:24:37Z, Jeffrey Tang <freebsd@hoolan.org> writes:

> Yes, I setup his 'change' field to some date to enforce my password change
> policy. When he logons, he gets a prompt to re-new password, but he can
> still press enter to skip this procedure and get the shell.

> So, is there any method to force users to change their stale passwords
> before granted permission to log in?

Try the BOFH approach.

Add this near the top of their .bashrc (or other shell startup script):

  passwd
  if [ $? != 0 ]; then
  	echo "Change your password.  I mean it."
        exit
  fi

Your user will *have* to change their password everytime he they log in
until they get wise to it.  Re-apply as necessary.
-- 
Kirk Strauser

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?873cwkte33.fsf>