From owner-freebsd-hackers@FreeBSD.ORG Sat Mar 17 01:55:21 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 2908916A400 for ; Sat, 17 Mar 2007 01:55:21 +0000 (UTC) (envelope-from youshi10@u.washington.edu) Received: from mxout7.cac.washington.edu (mxout7.cac.washington.edu [140.142.32.178]) by mx1.freebsd.org (Postfix) with ESMTP id 0797A13C468 for ; Sat, 17 Mar 2007 01:55:21 +0000 (UTC) (envelope-from youshi10@u.washington.edu) Received: from smtp.washington.edu (smtp.washington.edu [140.142.32.139]) by mxout7.cac.washington.edu (8.13.7+UW06.06/8.13.7+UW07.03) with ESMTP id l2H1tK11019025 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 16 Mar 2007 18:55:20 -0700 X-Auth-Received: from [192.168.10.41] (c-67-187-172-183.hsd1.ca.comcast.net [67.187.172.183]) (authenticated authid=youshi10) by smtp.washington.edu (8.13.7+UW06.06/8.13.7+UW07.03) with ESMTP id l2H1tJP3014364 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Fri, 16 Mar 2007 18:55:20 -0700 Message-ID: <45FB4A84.90509@u.washington.edu> Date: Fri, 16 Mar 2007 18:55:16 -0700 From: Garrett Cooper User-Agent: Thunderbird 1.5.0.10 (X11/20070316) MIME-Version: 1.0 To: freebsd-hackers@freebsd.org References: <387c4f3e.1c76814.28ed7ad1.29@madole.net> In-Reply-To: <387c4f3e.1c76814.28ed7ad1.29@madole.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-PMX-Version: 5.3.0.289146, Antispam-Engine: 2.5.0.283055, Antispam-Data: 2007.3.16.184434 X-Uwash-Spam: Gauge=IIIIIII, Probability=7%, Report='__CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __HAS_MSGID 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __SANE_MSGID 0, __USER_AGENT 0' 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: Sat, 17 Mar 2007 01:55:21 -0000 David S. Madole wrote: >> From Derekj Tourneo on Friday, March 16, 2007 4:46 PM >> >> How I recovered a lost root password in FreeBSD >> >> Luckily I did know one user name and it had no password. >> cgadmin >> >> going to the repair mode with CDROM/DVD option off the >> install menu, using the "live" CDROM filesystem gave me a >> root prompt Fixit# >> >> now mounting the hard drive, in my case /dev/ad0s3a >> >> mount /dev/ad0s3a /mnt >> ... >> >> now change permissions, but look at them first, make a note >> so you can put them back to the correct setting later chmod >> 777 /mnt/etc chmod 666 /mnt/etc/master.passwd >> >> reboot >> >> remove the CD and reboot the original system. >> For some reason my older FreeBSD version 4.3 filesystem did >> not like being mounted onto a FreeBSD 6.1 install CD Hence on >> reboot it made me do a manual fsck Then another reboot >> >> Now login as a user, cgadmin in my case >> get a prompt and run >> >> pwd_mkdb /etc/master.passwd > > You don't need to know another account nor do you need all those other steps. 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 partition it's on: > > /mnt/usr/sbin/pwd_mkdb -d /mnt/etc master.passwd > > Then just reboot and log in as root. > > David I am confused why this topic came up on this list.. -Garrett