From owner-freebsd-questions Sat Nov 9 17:50: 9 2002 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 7B2B037B401 for ; Sat, 9 Nov 2002 17:50:08 -0800 (PST) Received: from wantadilla.lemis.com (wantadilla.lemis.com [192.109.197.80]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3603743E3B for ; Sat, 9 Nov 2002 17:50:07 -0800 (PST) (envelope-from grog@lemis.com) Received: by wantadilla.lemis.com (Postfix, from userid 1004) id B1C1A518F9; Sun, 10 Nov 2002 12:20:03 +1030 (CST) Date: Sun, 10 Nov 2002 12:20:03 +1030 From: Greg 'groggy' Lehey To: joe Cc: FreeBSD Questions Subject: Recovering /etc/passwd (was: REASON #7919 NOT to do things as root!) Message-ID: <20021110015003.GB93051@wantadilla.lemis.com> References: <200211091725.54547.joe@dubium.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200211091725.54547.joe@dubium.com> User-Agent: Mutt/1.4i Organization: The FreeBSD Project Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-418-838-708 WWW-Home-Page: http://www.FreeBSD.org/ X-PGP-Fingerprint: 9A1B 8202 BCCE B846 F92F 09AC 22E6 F290 507A 4223 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 Saturday, 9 November 2002 at 17:25:54 -0800, joe wrote: > While playing around and trying to set aup a chroot environment > I did the following > cd /home/honza > mkdir {etc,dev,lib,bin,.....} > > cat /etc/passwd | grep honza >/etc/passwd > ^<== location of the > typing oops > The leading "/" was unintended. > > Aaaaaaaaaaaaahhhhh > > Now that everyone has gotten back off their seats from the laughter, on > a more serious note is there anything I can do. Let's pretend I don't > have a backup. ..... ok, now that you've stopped laughing again .... > > Is there anything I can do to recover /etc/passwd That's trivial. # pwd_mkdb -p /etc/master.passwd /etc/passwd doesn't get used much any more. The real files are /etc/pwd.db and /etc/spwd.db. See the man page for pwd_mkdb for more details. Greg -- When replying to this message, please copy the original recipients. If you don't, I may ignore the reply or reply to the original recipients. For more information, see http://www.lemis.com/questions.html See complete headers for address and phone numbers To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message