From owner-freebsd-questions Tue Feb 22 0:54:57 2000 Delivered-To: freebsd-questions@freebsd.org Received: from camelot.bitart.com (camelot.BITart.com [206.103.221.33]) by hub.freebsd.org (Postfix) with SMTP id 237E437B5CE for ; Tue, 22 Feb 2000 00:54:51 -0800 (PST) (envelope-from gerti@bitart.com) Received: (qmail 8333 invoked by uid 101); 22 Feb 2000 08:54:47 -0000 Message-ID: <20000222085447.8332.qmail@camelot.bitart.com> Content-Type: text/plain MIME-Version: 1.0 (NeXT Mail 4.2mach v148) In-Reply-To: <38A51F4A.3936BF3C@123HostIt.com> X-Nextstep-Mailer: Mail 4.2mach (Enhance 2.2p1) Received: by NeXT.Mailer (1.148) From: Gerd Knops Date: Tue, 22 Feb 2000 02:54:47 -0600 To: "rick - SomersNet, Inc." Subject: Re: changing ALL passwords Cc: freebsd-questions@FreeBSD.ORG Reply-To: gerti@BITart.com References: <38A51F4A.3936BF3C@123HostIt.com> Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG rick - SomersNet, Inc. wrote: > Hello.. > > I am trying to change all passwords. I have a flat text DB with all > usernames and new passwords. However using 'passwd' requires a human to > type the new password twice for it to be entered. But I need to do it > from perl. > > so my question.. is there any passwd scripts that allow a single command > line to change the password? such as 'passwd USER NEWPASS'? > $::PW='/usr/sbin/pw'; open(PW,"| $::PW usermod $userName -h 0"); print PW "$password\n"; close(PW) or die("An error occured while trying to ". "change the password for user $userName!"); Gerd To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message