From owner-freebsd-questions Wed May 22 11:34:13 2002 Delivered-To: freebsd-questions@freebsd.org Received: from boris.st.hmc.edu (boris.ST.HMC.Edu [134.173.63.11]) by hub.freebsd.org (Postfix) with ESMTP id 2F17037B40D for ; Wed, 22 May 2002 11:34:10 -0700 (PDT) Received: (from root@localhost) by boris.st.hmc.edu (8.11.6/8.11.6) id g4MIYAC36783; Wed, 22 May 2002 11:34:10 -0700 (PDT) (envelope-from jeff@boris.st.hmc.edu) Received: from localhost (jeff@localhost) by boris.st.hmc.edu (8.11.6/8.11.6av) with ESMTP id g4MIY7Z36775; Wed, 22 May 2002 11:34:07 -0700 (PDT) (envelope-from jeff@boris.st.hmc.edu) X-Authentication-Warning: boris.st.hmc.edu: jeff owned process doing -bs Date: Wed, 22 May 2002 11:34:07 -0700 (PDT) From: Jeff Jirsa To: Kirk Strauser Cc: Subject: Re: How to force one user to change his password? In-Reply-To: <873cwkte33.fsf@strauser.com> Message-ID: <20020522113005.X36741-100000@boris.st.hmc.edu> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by Amavis on boris.st.hmc.edu Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 22 May 2002, Kirk Strauser wrote: > > > 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. I haven't checked, but I suppose that'll work well, if you like the BOFH approach. If you just want to force them to change it, backup one of the startup scripts (script.bak), put the above code into one copy, and below it, restore the original script after the change is complete: passwd if [ $? != 0 ]; then echo "Change your password. I mean it." exit else mv [login-script.bak] [login-script] fi Then you won't have to worry about him complaining that he has to change his password daily, in case he's not smart enough to realize what had happened. - Jeff Jirsa To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message