From owner-freebsd-questions Mon Jan 15 7:10:34 2001 Delivered-To: freebsd-questions@freebsd.org Received: from foghorn.strategicit.net (exchange.strategicit.net [207.17.172.204]) by hub.freebsd.org (Postfix) with ESMTP id 16DF437B401 for ; Mon, 15 Jan 2001 07:10:17 -0800 (PST) Received: by exchange.strategicit.net with Internet Mail Service (5.5.2650.21) id ; Mon, 15 Jan 2001 10:13:13 -0500 Message-ID: <6381A6A8826BD31199500090279CAFBA24F467@exchange.strategicit.net> From: "Portwood, Jason" To: "'tech@squid.tznet.com'" , "'freebsd-questions@FreeBSD.ORG'" Subject: RE: Mail Server & Adduser Date: Mon, 15 Jan 2001 10:13:12 -0500 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: text/plain; charset="iso-8859-1" Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > We have a file of 7-8k users and passwords (format is somewhat of 'user > pass more info more info etc', however it's one user & password per > line, easily transforable to a script). We need a way to add a user in a > single command line. Adduser dosen't cut it and pw does add a user ina > single command line, but dosen't include the password. I think pw and perl is the answer here. There is a user entry program called enteruser (http://www.de.daemonnews.org/199908/enteruser.html) and in there it has the magic line to do what I think you want. open( PW, "| $pw_path useradd $username -c \"$fullname\" -m -s $shell -h 0" ) or die "$pw_path failure: $!"; print PW $password, "\n"; That will add the account with the password. Just some modifications to that program and it should do what you need it to. Hope that helps, it worked for me. Jason Portwood (jason@iac.net) Internet Systems Administrator Strategic / Internet Access Cincinnati Sales & Tech Support 513-860-9052 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message