Date: Fri, 22 Jul 2005 03:24:06 +0200 From: Tobias Fendin <tobias.fendin@telia.com> To: freebsd-questions@freebsd.org Subject: Re: password expire Message-ID: <42E04AB6.9000501@telia.com> In-Reply-To: <005d01c58e3d$0ff71f10$c901a8c0@workdog> References: <005d01c58e3d$0ff71f10$c901a8c0@workdog>
next in thread | previous in thread | raw e-mail | index | archive | help
Gayn Winters wrote:
>
>>-----Original Message-----
>>From: owner-freebsd-questions@freebsd.org
>>[mailto:owner-freebsd-questions@freebsd.org] On Behalf Of
>>Tobias Fendin
>>Sent: Thursday, July 21, 2005 11:31 AM
>>To: Joe Stuart
>>Cc: freebsd-questions@freebsd.org
>>Subject: Re: password expire
>>
>>
>>Joe Stuart wrote:
>>
>>>I have a whole group of users with weak passwords. Is there
>>
>>a way that I can force a password change at next login?
>>
>>
>>"pw usermod [name|uid] -p date" should do the trick.
>>Check the pw(8) man-page for more details.
>>
>> -Tobias
>
>
> OK, but if a "whole group" is many many users, how can one pipe-in the
> list of users? I have a similar problem updating one of my user groups,
> and typing in a pw for each user is a little painful. Maybe one of the
> shell wizards out there can give us a lesson. TIA,
>
> -gayn
>
>
>
well, this might not be nice, but hey, it's a hack :)
for USER in `pw groupshow <your group> |awk -F ":" '{print $4}'| sed
's/,/ /1'`
do
pw usermod $USER -p <date>
done
-Tobias
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?42E04AB6.9000501>
