From owner-freebsd-hackers@FreeBSD.ORG Fri Mar 16 21:57:25 2007 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B0B2816A403 for ; Fri, 16 Mar 2007 21:57:25 +0000 (UTC) (envelope-from david@madole.net) Received: from d.omd3.com (mx1.omd3.com [69.90.174.41]) by mx1.freebsd.org (Postfix) with ESMTP id 8FF0E13C458 for ; Fri, 16 Mar 2007 21:57:25 +0000 (UTC) (envelope-from david@madole.net) Received: from [66.212.193.19] (helo=david) by d.omd3.com with esmtpa (Exim 4.54) id 1HSKDW-000KhL-SV; Fri, 16 Mar 2007 17:44:07 -0400 Date: Fri, 16 Mar 2007 17:44:00 -0400 From: "David S. Madole" To: 'Derekj Tourneo' , "'freebsd-hackers@freebsd.org'" Message-ID: <387c4f3e.1c76814.28ed7ad1.29@madole.net> X-Priority: 3 Organization: Optimized Micro Devices X-Mailer: Bynari Insight Connector 3.1.3-0315164 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Cc: Subject: RE: One method to recover a lost root password X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Mar 2007 21:57:25 -0000 > From Derekj Tourneo on Friday, March 16, 2007 4:46 PM >=20 > How I recovered a lost root password in FreeBSD >=20 > Luckily I did know one user name and it had no password. > cgadmin=20 >=20 > going to the repair mode with CDROM/DVD option off the=20 > install menu, using the "live" CDROM filesystem gave me a=20 > root prompt Fixit# >=20 > now mounting the hard drive, in my case /dev/ad0s3a >=20 > =09mount /dev/ad0s3a /mnt > ... >=20 > now change permissions, but look at them first, make a note=20 > so you can put them back to the correct setting later chmod =20 > 777 /mnt/etc chmod 666 /mnt/etc/master.passwd >=20 > reboot >=20 > remove the CD and reboot the original system. =20 > For some reason my older FreeBSD version 4.3 filesystem did=20 > not like being mounted onto a FreeBSD 6.1 install CD Hence on=20 > reboot it made me do a manual fsck Then another reboot >=20 > Now login as a user, cgadmin in my case > get a prompt and run >=20 > =09pwd_mkdb /etc/master.passwd You don't need to know another account nor do you need all those other step= s. After you edit the /etc/master.passwd file by booting from the fixit CD = simply: pwd_mkdb -d /mnt/etc master.passwd If pwd_mkdb is not on the fixit CD -- I don't remember if it is -- you can = run it from your hard drive something like this, depending on what partitio= n it's on: /mnt/usr/sbin/pwd_mkdb -d /mnt/etc master.passwd Then just reboot and log in as root. David