From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Kngm5-0000P0-38 for mharc-grub-devel@gnu.org; Wed, 08 Oct 2008 17:40:53 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kngm3-0000OE-G4 for grub-devel@gnu.org; Wed, 08 Oct 2008 17:40:51 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kngm2-0000Nl-QI for grub-devel@gnu.org; Wed, 08 Oct 2008 17:40:51 -0400 Received: from [199.232.76.173] (port=56360 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kngm0-0000Mn-Dj; Wed, 08 Oct 2008 17:40:49 -0400 Received: from lax-green-bigip-5.dreamhost.com ([208.113.200.5]:48101 helo=blingymail-a1.g.dreamhost.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Kngm0-0002Xn-78; Wed, 08 Oct 2008 17:40:48 -0400 Received: from jidanni2.jidanni.org (122-127-33-88.dynamic.hinet.net [122.127.33.88]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by blingymail-a1.g.dreamhost.com (Postfix) with ESMTP id A63A35C994; Wed, 8 Oct 2008 14:40:44 -0700 (PDT) To: grub-devel@gnu.org References: <20081007095652.GD7127@fencepost.gnu.org> From: jidanni@jidanni.org Date: Thu, 09 Oct 2008 05:40:32 +0800 Message-ID: <87skr6935b.fsf_-_@jidanni.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 1) Cc: bug-grub@gnu.org Subject: forgot passwd, cannot login, [rd]init=/bin/sh don't work X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Oct 2008 21:40:51 -0000 Gentlemen, last time I forgot my password and couldn't log into my machine here on my far away rural mountaintop, I ended up digging up an old Debian "potato" CDROM and installing it into some free space on my disk, from which I could edit /etc/passwd and zero out the password. These days that would no longer necessarily work, see man mkfs.ext3 -I. > Presuming Linux, you can add "init=/bin/sh" to the kernel command line. This > will give you a shell without asking for a password. From this shell you can > edit your password file. Didn't work. >Initrd scripts might change everything. OK, I then tried linux-doc-2.6.26/Documentation/kernel-parameters.txt.gz: rdinit= [KNL] Format: Run specified binary instead of /init from the ramdisk, used for early userspace startup. See initrd. So in grub2 I chose "e" to edit, and changed the lines to linux /boot/vmlinuz-2.6.26-1-686 root=UUID=... rdinit=/bin/sh initrd /boot/initrd.img-2.6.26-1-686 hit ESC then RET, and alas it was like I didn't type anything at all but just hit RET, booting proceeded as usual, and /proc/cmdline shows that my changes to that command line were thrown away.