From owner-freebsd-questions@FreeBSD.ORG Wed Mar 18 16:25:08 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7712E106568A for ; Wed, 18 Mar 2009 16:25:08 +0000 (UTC) (envelope-from wmoran@potentialtech.com) Received: from mail.potentialtech.com (internet.potentialtech.com [66.167.251.6]) by mx1.freebsd.org (Postfix) with ESMTP id 37E2A8FC1D for ; Wed, 18 Mar 2009 16:25:08 +0000 (UTC) (envelope-from wmoran@potentialtech.com) Received: from vanquish.ws.pitbpa0.priv.collaborativefusion.com (pr40.pitbpa0.pub.collaborativefusion.com [206.210.89.202]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.potentialtech.com (Postfix) with ESMTPSA id 1E289EBC0A; Wed, 18 Mar 2009 12:25:07 -0400 (EDT) Date: Wed, 18 Mar 2009 12:25:06 -0400 From: Bill Moran To: Jerry McAllister Message-Id: <20090318122506.8829a34d.wmoran@potentialtech.com> In-Reply-To: <20090318161616.GA62837@gizmo.acns.msu.edu> References: <20090318161616.GA62837@gizmo.acns.msu.edu> X-Mailer: Sylpheed 2.6.0 (GTK+ 2.14.7; i386-portbld-freebsd7.1) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Joe Chimento , freebsd-questions@freebsd.org Subject: Re: renaming user account? 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, 18 Mar 2009 16:25:09 -0000 In response to Jerry McAllister : > On Wed, Mar 18, 2009 at 11:27:39AM -0400, Joe Chimento wrote: > > > Is there an easy way to rename a user account belonging to 'www' group? > > > > You could just use vipw(8) and edit the id name in the password entry. > > Or, do you mean you want to change the group the user belongs to? > If it is the user's primary group, then also use vipw to edit the entry. > If it is a secondary group for that user, then edit the line in > the /etc/group file and remove that user from it. Put it in another > group then if you want. > > You might also have to change group ownership on files if you change > the GID as well. Jerry's advice is sound. However, the canonical way to do this is using the pw command. pw will sanity check all your changes to ensure you don't end up with a groups file that doesn't match your master.password, etc. Unfortunately, the pw syntax is rather complex: http://www.freebsd.org/cgi/man.cgi?query=pw&apropos=0&sektion=0&manpath=FreeBSD+7.1-RELEASE&format=html It's somewhat better suited for use in scripts than use by humans. -- Bill Moran http://www.potentialtech.com http://people.collaborativefusion.com/~wmoran/