From owner-freebsd-questions Mon Jan 21 7:36:41 2002 Delivered-To: freebsd-questions@freebsd.org Received: from marlo.eagle.ca (marlo.eagle.ca [209.167.16.10]) by hub.freebsd.org (Postfix) with ESMTP id 1A73537B402 for ; Mon, 21 Jan 2002 07:36:36 -0800 (PST) Received: from Bob (staff.eagle.ca [209.167.16.15]) by marlo.eagle.ca (8.11.3/8.11.3) with ESMTP id g0LFXtp31555; Mon, 21 Jan 2002 10:34:00 -0500 (EST) (envelope-from freymann@eagle.ca) From: "ScaryG" To: "Joe & Fhe Barbish" , "FBSD Questions" Date: Mon, 21 Jan 2002 10:37:28 -0500 MIME-Version: 1.0 Subject: Re: How to adduser from script? Message-ID: <3C4BEF68.32535.78858E@localhost> In-reply-to: X-mailer: Pegasus Mail for Windows (v4.01) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Content-description: Mail message body 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 On 21 Jan 2002 at 10:26, Joe & Fhe Barbish wrote: > I am building a disaster recovery script. > I need to add 2 users, backup tape user, > and remote admin user. > Is there a command line command that I can do this with? I just recently did some tinkering with this, and the following works fine in a perl script: #/usr/bin/perl $password = "abc123"; $shell = "/sbin/nologin"; $username = "lusername"; `echo $password |/usr/sbin/pw adduser -s $shell -m -n $username -d /home/$username -h 0`; Have fun. gf To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message