From owner-freebsd-questions@FreeBSD.ORG Tue Apr 6 02:38:20 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C1D6F16A4CE for ; Tue, 6 Apr 2004 02:38:20 -0700 (PDT) Received: from mail.u4eatech.com (blackhole.u4eatech.com [195.188.241.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7BBE043D53 for ; Tue, 6 Apr 2004 02:38:19 -0700 (PDT) (envelope-from richard.williamson@u4eatech.com) Received: (from filter@localhost) by mail.u4eatech.com (8.11.6/8.11.6) id i369bsh26322; Tue, 6 Apr 2004 10:37:54 +0100 X-Authentication-Warning: mail.u4eatech.com: filter set sender to richard.williamson@u4eatech.com using -f Received: from apus.u4eatech.com (unknown [172.30.20.100]) by mail.u4eatech.com (Postfix) with ESMTP id 69A5515780B; Tue, 6 Apr 2004 10:37:42 +0100 (BST) Message-Id: <6.0.3.0.2.20040406103930.024b46c0@cygnus> X-Sender: richard@cygnus X-Mailer: QUALCOMM Windows Eudora Version 6.0.3.0 Date: Tue, 06 Apr 2004 10:41:10 +0100 To: freebsd-questions@freebsd.org From: "Richard P. Williamson" In-Reply-To: <50433.192.168.0.105.1081162139.squirrel@webmail.thilelli.n et> References: <6.0.3.0.2.20040405112307.024b63c8@cygnus> <50433.192.168.0.105.1081162139.squirrel@webmail.thilelli.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Spam-Status: No, hits=-6.7 required=5.0 tests=BAYES_01,EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT, REFERENCES,REPLY_WITH_QUOTES autolearn=ham version=2.55 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) cc: Julien Gabel cc: Nelis Lamprecht Subject: Re: changing root password. X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Apr 2004 09:38:20 -0000 Thanks, that's got it. vipw(8) was what I needed, in that it allows one to keep the databases in sync with the password files, which was more the problem. rip At 11:48 05/04/2004, Julien Gabel wrote: >> I've got a 4.8R system that I use for development of a 'freebsd-small' >> type network device. The network device environment runs out of >> memory, the kernel and an mfsroot.gz image coming from a 32Mb pccard >> Compact Flash drive. >> >> The mfsroot.gz development image is stored as a vnconfig vn0 >> virtual node, called 'mfsroot', on the development machine. >> >> Everything boots and I can do what I want with the system. >> >> The problem is that I need to be able to set the root password >> of the device, from the development machine prior to moving to >> the actual device. >> >> So I (or rather, 'root') mount(s) the virtual fs node: >> >> % vnconfig vn0 mfsroot >> % mount /dev/vn0 /mnt >> >> (under /mnt now is a partially functional FreeBSD 4.8R based >> installation, including /etc/master.passwd, etc) >> >> And then change the root directory to the mount point: >> >> % chroot /mnt >> >> And then try to change the password: >> >> % passwd >> Type new password: >> Retype new password: >> ... >> % >> >> The behavior I'm seeing is that the /original/ /etc/ password >> files and databases are updated, and not the [/mnt]/etc/ password >> files. >> >> Am I expecting incorrectly? Am I going to be able to change the >> network device's root password before moving to the actual device >> from the development machine, or will it be necessary to put >> /usr/bin/passwd onto the network device? > >The problem is that passwd(1) works only on /etc/master.passwd and >/etc/passwd. In order to set the password, I think the simplest way >is to set the wanted password on another system and copy & paste it >using vipw(8) using 'vipw -d /mnt/etc'. > >-- >-jpeg. >_______________________________________________ >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"