From owner-freebsd-questions Mon Jan 21 16:26: 2 2002 Delivered-To: freebsd-questions@freebsd.org Received: from po3.wam.umd.edu (po3.wam.umd.edu [128.8.10.165]) by hub.freebsd.org (Postfix) with ESMTP id 9DD5C37B405 for ; Mon, 21 Jan 2002 16:25:57 -0800 (PST) Received: from rac4.wam.umd.edu (IDENT:root@rac4.wam.umd.edu [128.8.10.144]) by po3.wam.umd.edu (8.9.3/8.9.3) with ESMTP id TAA24826; Mon, 21 Jan 2002 19:25:53 -0500 (EST) Received: from rac4.wam.umd.edu (IDENT:sendmail@localhost [127.0.0.1]) by rac4.wam.umd.edu (8.9.3/8.9.3) with SMTP id TAA19611; Mon, 21 Jan 2002 19:25:53 -0500 (EST) Received: from localhost (gollucci@localhost) by rac4.wam.umd.edu (8.9.3/8.9.3) with ESMTP id TAA19607; Mon, 21 Jan 2002 19:25:52 -0500 (EST) X-Authentication-Warning: rac4.wam.umd.edu: gollucci owned process doing -bs Date: Mon, 21 Jan 2002 19:25:52 -0500 (EST) From: "Philip M. Gollucci" To: ScaryG Cc: Joe & Fhe Barbish , FBSD Questions Subject: Re: How to adduser from script? In-Reply-To: <3C4BEF68.32535.78858E@localhost> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 I don't know if this is a good idea, but I have a web based login system. It creates the users in a MySQL database. This is all fine and good, but I want to also add them as system users in master.passwd . It is my understanding that I need to do some kind of setuid script like the one below. Anyone how or where to look. ***************************************************************************** Philip M. Gollucci (p6m7g8) Web-site : http://www.p6m7g8.com E-mail : gollucci@wam.umd.edu Philip@p6m7g8.com Phone : 301.249.6261 (Home) 301.314.3118 (College) Major : Computer Science Minor : Classical & Jazz Performance Current Job : Science, Discovery, & the Universe Webmaster URL: http://www.sdu.umd.edu Resume : http://www.wam.umd.edu/~gollucci/resume.html ***************************************************************************** On Mon, 21 Jan 2002, ScaryG wrote: > > 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 > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message