Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Feb 2000 02:54:47 -0600
From:      Gerd Knops <gerti@bitart.com>
To:        "rick - SomersNet, Inc." <rick@123HostIt.com>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: changing ALL passwords
Message-ID:  <20000222085447.8332.qmail@camelot.bitart.com>
In-Reply-To: <38A51F4A.3936BF3C@123HostIt.com>
References:  <38A51F4A.3936BF3C@123HostIt.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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




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