From owner-freebsd-questions@FreeBSD.ORG Wed Apr 4 14:41:37 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 42BE316A401 for ; Wed, 4 Apr 2007 14:41:37 +0000 (UTC) (envelope-from jhary@unsane.co.uk) Received: from unsane.co.uk (www.unsane.co.uk [85.233.185.162]) by mx1.freebsd.org (Postfix) with ESMTP id C39BD13C448 for ; Wed, 4 Apr 2007 14:41:36 +0000 (UTC) (envelope-from jhary@unsane.co.uk) Received: from [192.168.10.217] (150.117-84-212.staticip.namesco.net [212.84.117.150]) (authenticated bits=0) by unsane.co.uk (8.14.0/8.14.0) with ESMTP id l34EfRJH038961 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 4 Apr 2007 15:41:28 +0100 (BST) (envelope-from jhary@unsane.co.uk) Message-ID: <4613B91B.5000104@unsane.co.uk> Date: Wed, 04 Apr 2007 15:41:31 +0100 From: Vince User-Agent: Thunderbird 1.5.0.10 (X11/20070327) MIME-Version: 1.0 To: Agus References: <4612E800.3010408@daleco.biz> <4612F4BA.3030704@daleco.biz> In-Reply-To: X-Enigmail-Version: 0.94.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-questions Subject: Re: Non Interactive passwd change via script.... X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Apr 2007 14:41:37 -0000 Agus wrote: > > > OK..thanks for the heads up about responding.... > > The problem isnt adding the user....i ve done that......the problem is > creating the password for the user as i tried to say in the first email... > Assuming you dont mean actually generating the password maybe you need the -h fd flag to pw or more specificly (from the manpage) pw will prompt for the user's password if -h 0 is given, nominating stdin as the file descriptor on which to read the password. Note that this password will be read only once and is intended for use by a script rather than for interactive use. so something like echo PASSWD | pw add user wibble -h 0 will create a user wibble with password of PASSWD or echo $PASSWORD | pw add user $USERNAME -h 0 setting $PASSWORD and $USERNAME as needed. Vince > thanks kevin, > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to > "freebsd-questions-unsubscribe@freebsd.org"