Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 Jan 2002 22:47:11 -0800
From:      Sean Ellis <sellis@telus.net>
To:        "Joe & Fhe Barbish" <barbish@a1poweruser.com>
Cc:        "FBSD Questions" <questions@FreeBSD.ORG>
Subject:   Re: pw in script to create new user.
Message-ID:  <1381391589634.20020121224711@telus.net>
In-Reply-To: <LPBBIGIAAKKEOEJOLEGOKEFHCNAA.barbish@a1poweruser.com>
References:  <LPBBIGIAAKKEOEJOLEGOKEFHCNAA.barbish@a1poweruser.com>

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

Monday, January 21, 2002, 8:52:00 PM, you wrote:

> I have sh script with this in it
> Pw adduser tom -m -c bkup manager -o
> The /etc/pw.conf has all the defaults, one is to 
> make the password the same as the userid. 
> The -o option will take input from keyboard for the 
> Password but this is a canned script so I need to  
> Some how pass the password value to the pw command -0 option.

I wrote a few lines of perl to automate account creation working from
a list of userid's. I've cut out the relevant part (hopefully from a
good version :). You get the idea; of course it's not sh, but perl is
all over.

open(NAME, "< $file") || die "couldn't open $file: $!\n";

while (<NAME>) {

        chomp;

    `echo $_ | pw usermod -n $_ -h 0`;

}

close(NAME) || die "couldn't close names: $!\n";

original here:

http://64.69.77.155/caveat_emptor/user_pass_create

> How can I configure the script to hold the password value 
> for that userid so when the pw adduser command is executed 
> the correct password gets used in creating the user?

> A example of the script  pw command would be great.

> Thanks
> Joe 

-- 
Regards,
 Sean                            mailto:sellis@telus.net



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?1381391589634.20020121224711>