From owner-freebsd-questions Mon Jan 21 22:39:37 2002 Delivered-To: freebsd-questions@freebsd.org Received: from priv-edtnes03-hme0.telusplanet.net (fepout1.telus.net [199.185.220.236]) by hub.freebsd.org (Postfix) with ESMTP id CB4FE37B400 for ; Mon, 21 Jan 2002 22:39:23 -0800 (PST) Received: from FRED ([142.173.43.70]) by priv-edtnes03-hme0.telusplanet.net (InterMail vM.5.01.04.01 201-253-122-122-101-20011014) with ESMTP id <20020122063923.FJXT27120.priv-edtnes03-hme0.telusplanet.net@FRED>; Mon, 21 Jan 2002 23:39:23 -0700 Date: Mon, 21 Jan 2002 22:47:11 -0800 From: Sean Ellis X-Mailer: The Bat! (v1.51) Reply-To: Sean Ellis Organization: yes X-Priority: 3 (Normal) Message-ID: <1381391589634.20020121224711@telus.net> To: "Joe & Fhe Barbish" Cc: "FBSD Questions" Subject: Re: pw in script to create new user. In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 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 () { 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