All of lore.kernel.org
 help / color / mirror / Atom feed
* forgot passwd, cannot login, [rd]init=/bin/sh don't work
       [not found] <20081007095652.GD7127@fencepost.gnu.org>
@ 2008-10-08 21:40 ` jidanni
  2008-10-08 23:09   ` walt
  2008-10-09 18:19   ` Niels Böhm
  0 siblings, 2 replies; 9+ messages in thread
From: jidanni @ 2008-10-08 21:40 UTC (permalink / raw)
  To: grub-devel; +Cc: bug-grub

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: <full_path>
   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.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: forgot passwd, cannot login, [rd]init=/bin/sh don't work
  2008-10-08 21:40 ` jidanni
@ 2008-10-08 23:09   ` walt
  2008-10-09 18:19   ` Niels Böhm
  1 sibling, 0 replies; 9+ messages in thread
From: walt @ 2008-10-08 23:09 UTC (permalink / raw)
  To: grub-devel; +Cc: bug-grub

jidanni@jidanni.org wrote:
 > ...
> OK, I then tried linux-doc-2.6.26/Documentation/kernel-parameters.txt.gz:
>    rdinit=  [KNL]
>     Format:<full_path>
>     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.

The only reason to use a ramdisk during boot is if your kernel
doesn't have any support for your root filesystem (unlikely) or
for your hardware (much more likely).

If the disk controller on your motherboard isn't too exotic you
could probably boot the kernel directly, i.e:
/boot/vmlinuz-2.6.26-1-686 init=/bin/sh root=whatever
Note the use of *init* instead of rdinit because you aren't
using the initial ramdisk this way.

May or may not work, but it's worth a try.




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: forgot passwd, cannot login, [rd]init=/bin/sh don't work
       [not found] <4728c15d0810081751i57cfe910x9aa321f25f89495a@mail.gmail.com>
@ 2008-10-09  1:09 ` jidanni
  0 siblings, 0 replies; 9+ messages in thread
From: jidanni @ 2008-10-09  1:09 UTC (permalink / raw)
  Cc: grub-devel

AW> If you have a LiveCD or recovery CD which many distros of linux have, then
AW> boot under that. Then, when you are in the root shell, you can mount your
AW> systems partition, and then you can use the command chroot
AW> <place_where_you_mounted_your_filesystem>. That will make the live cd use
AW> your systems file system. Then simply passwd as root, and make your new root
AW> password.

Yes but as happened to me before, when one digs out one's old live CDs,
they often cannot deal with the newer filesystems (man mkfs.ext3 -I),
so I was wondering if there was a grub way rather than burning new
live CDs every few years.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: forgot passwd, cannot login, [rd]init=/bin/sh don't work
  2008-10-08 21:40 ` jidanni
  2008-10-08 23:09   ` walt
@ 2008-10-09 18:19   ` Niels Böhm
  2008-10-11  2:46     ` jidanni
  1 sibling, 1 reply; 9+ messages in thread
From: Niels Böhm @ 2008-10-09 18:19 UTC (permalink / raw)
  To: The development of GRUB 2

On Wednesday 08 October 2008, jidanni@jidanni.org wrote:
>
> 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.

That's normal behaviour, if you press ESC all your changes are gone.

The solution is not to press ESC, but Ctrl-x instead. There's also a hint 
about that in the online help below the editor frame.


Niels Böhm



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: forgot passwd, cannot login, [rd]init=/bin/sh don't work
  2008-10-09 18:19   ` Niels Böhm
@ 2008-10-11  2:46     ` jidanni
  2008-10-15 18:41       ` jidanni
  0 siblings, 1 reply; 9+ messages in thread
From: jidanni @ 2008-10-11  2:46 UTC (permalink / raw)
  To: grub-devel

Ah, no wonder. These need rewording:

 Use the %C and %C keys to select which entry is highlighted.
 Press enter to boot the selected OS, 'e' to edit the
 commands before booting or 'c' for a command-line.

 Minimum Emacs-like screen editing is supported. TAB lists
 available completions. Press C-x ('x' with Ctrl) to boot,
 C-c ('c' with Ctrl) for a command-line or ESC to return menu.

Here, I have reworded the latter, preserving terseness, and fixing grammar:

 Minimum Emacs-like editing is supported. TAB lists available
 completions. Press C-x ('x' with Ctrl) to boot, C-c for a
 command-line or ESC to throw away changes and return to menu.

Kindly integrate it into your next version. Thank you.

(There is also a grub screen with its several lines of help text
enclosed by "[  ]". Might as well chuck them too.)

By the way, I indeed now could login now without remembering the password. Use
 linux	/boot/vmlinuz-... root=... rw init=/bin/sh
 initrd	/boot/initrd.img-...
The key is the "rw init=/bin/sh". (And after editing /etc/passwd to change
root's :x: to ::, be sure not to just exit the shell, but hit
CTRL-ALT-DEL, else one has to push the reset button.)



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: forgot passwd, cannot login, [rd]init=/bin/sh don't work
  2008-10-11  2:46     ` jidanni
@ 2008-10-15 18:41       ` jidanni
  0 siblings, 0 replies; 9+ messages in thread
From: jidanni @ 2008-10-15 18:41 UTC (permalink / raw)
  To: grub-devel

Can somebody please integrate my patches? For the parent article and
the "grub-install message should mention --recheck" article.

I am a mere "apt-get install" user. I fear if I learn your whole
source code system, and finally make an official patch, it too will
fall on deaf ears.

As I expect I will only have one patch per three years, please
integrate it for me. Thanks.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: forgot passwd, cannot login, [rd]init=/bin/sh don't work
@ 2008-10-17 12:26 James Shewey
  2008-10-18  3:44 ` Cameron Braid
  0 siblings, 1 reply; 9+ messages in thread
From: James Shewey @ 2008-10-17 12:26 UTC (permalink / raw)
  To: The development of GRUB 2

Grub does not manage ubuntu or debian's (or any other distribution's) repositories and has no control  over how often these distros recompile and update these packages. Only their own codebase which is stored in their svn codebase. Debian'snewest package is a little out of date, and ubuntu's newest  package is _really_ out of date. This means that your patch may have already installed your patch in the grub2 codebase and by installing fro your distributon's repository, you wouldn't even know. This means that you can  either  a) file a bug report with your distrbution and wait for the package to propigate (which cold take up to 6 mos for ubuntu for the jaunty jackalope 9.04 release and even longer for debian, depending. You could speed this up by running the alpha version of your distro, but this is not recommended.) or b) break down and install from grub2 svn. Installing from svn is not very hard. The commands are:

svn co http://url
Cd grub2
./configure
make
sudo make install

You would need to look up the url for the grub svn though. Also be aware that grub2 will not compile on a 64 bit system yet.

James

-----Original Message-----
From: jidanni@jidanni.org
Sent: Wednesday, October 15, 2008 2:41 PM
To: grub-devel@gnu.org
Subject: Re: forgot passwd, cannot login, [rd]init=/bin/sh don't work

Can somebody please integrate my patches? For the parent article and
the "grub-install message should mention --recheck" article.

I am a mere "apt-get install" user. I fear if I learn your whole
source code system, and finally make an official patch, it too will
fall on deaf ears.

As I expect I will only have one patch per three years, please
integrate it for me. Thanks.


_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: forgot passwd, cannot login, [rd]init=/bin/sh don't work
  2008-10-17 12:26 James Shewey
@ 2008-10-18  3:44 ` Cameron Braid
  2008-10-18 12:20   ` Steven Trotter
  0 siblings, 1 reply; 9+ messages in thread
From: Cameron Braid @ 2008-10-18  3:44 UTC (permalink / raw)
  To: The development of GRUB 2

[-- Attachment #1: Type: text/plain, Size: 2659 bytes --]

On Fri, Oct 17, 2008 at 10:26 PM, James Shewey <jdshewey@gmail.com> wrote:

> Grub does not manage ubuntu or debian's (or any other distribution's)
> repositories and has no control  over how often these distros recompile and
> update these packages. Only their own codebase which is stored in their svn
> codebase. Debian'snewest package is a little out of date, and ubuntu's
> newest  package is _really_ out of date. This means that your patch may have
> already installed your patch in the grub2 codebase and by installing fro
> your distributon's repository, you wouldn't even know. This means that you
> can  either  a) file a bug report with your distrbution and wait for the
> package to propigate (which cold take up to 6 mos for ubuntu for the jaunty
> jackalope 9.04 release and even longer for debian, depending. You could
> speed this up by running the alpha version of your distro, but this is not
> recommended.) or b) break down and install from grub2 svn. Installing from
> svn is not very hard. The commands are:
>
> svn co http://url
> Cd grub2
> ./configure
> make
> sudo make install
>
> You would need to look up the url for the grub svn though. Also be aware
> that grub2 will not compile on a 64 bit system yet.
>

cameronbraid@beast:grub2$ svn info
Path: .
URL: svn://svn.sv.gnu.org/grub/trunk/grub2
Repository Root: svn://svn.sv.gnu.org/grub
Repository UUID: d0de0278-0dc1-4c01-8a07-af38b3205e46
Revision: 1886
Node Kind: directory
Schedule: normal
Last Changed Author: robertmh
Last Changed Rev: 1886
Last Changed Date: 2008-10-05 20:51:23 +1000 (Sun, 05 Oct 2008)

cameronbraid@beast:grub2$ uname -a
Linux beast 2.6.24-19-generic #1 SMP Wed Aug 20 17:53:40 UTC 2008
*x86_64*GNU/Linux

Compiles fine for me

Cameron




>
> James
>
> -----Original Message-----
> From: jidanni@jidanni.org
> Sent: Wednesday, October 15, 2008 2:41 PM
> To: grub-devel@gnu.org
> Subject: Re: forgot passwd, cannot login, [rd]init=/bin/sh don't work
>
> Can somebody please integrate my patches? For the parent article and
> the "grub-install message should mention --recheck" article.
>
> I am a mere "apt-get install" user. I fear if I learn your whole
> source code system, and finally make an official patch, it too will
> fall on deaf ears.
>
> As I expect I will only have one patch per three years, please
> integrate it for me. Thanks.
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
>
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
>

[-- Attachment #2: Type: text/html, Size: 3858 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: forgot passwd, cannot login, [rd]init=/bin/sh don't work
  2008-10-18  3:44 ` Cameron Braid
@ 2008-10-18 12:20   ` Steven Trotter
  0 siblings, 0 replies; 9+ messages in thread
From: Steven Trotter @ 2008-10-18 12:20 UTC (permalink / raw)
  To: The development of GRUB 2

[-- Attachment #1: Type: text/plain, Size: 3073 bytes --]

What does the configure script output for the lines that say

Checking build/host/target system type ...

Steve

On 18 Oct 2008, at 04:44, "Cameron Braid" <cameron@braid.com.au> wrote:

>
>
> On Fri, Oct 17, 2008 at 10:26 PM, James Shewey <jdshewey@gmail.com>  
> wrote:
> Grub does not manage ubuntu or debian's (or any other  
> distribution's) repositories and has no control  over how often  
> these distros recompile and update these packages. Only their own  
> codebase which is stored in their svn codebase. Debian'snewest  
> package is a little out of date, and ubuntu's newest  package is  
> _really_ out of date. This means that your patch may have already  
> installed your patch in the grub2 codebase and by installing fro  
> your distributon's repository, you wouldn't even know. This means  
> that you can  either  a) file a bug report with your distrbution and  
> wait for the package to propigate (which cold take up to 6 mos for  
> ubuntu for the jaunty jackalope 9.04 release and even longer for  
> debian, depending. You could speed this up by running the alpha  
> version of your distro, but this is not recommended.) or b) break  
> down and install from grub2 svn. Installing from svn is not very  
> hard. The commands are:
>
> svn co http://url
> Cd grub2
> ./configure
> make
> sudo make install
>
> You would need to look up the url for the grub svn though. Also be  
> aware that grub2 will not compile on a 64 bit system yet.
>
> cameronbraid@beast:grub2$ svn info
> Path: .
> URL: svn://svn.sv.gnu.org/grub/trunk/grub2
> Repository Root: svn://svn.sv.gnu.org/grub
> Repository UUID: d0de0278-0dc1-4c01-8a07-af38b3205e46
> Revision: 1886
> Node Kind: directory
> Schedule: normal
> Last Changed Author: robertmh
> Last Changed Rev: 1886
> Last Changed Date: 2008-10-05 20:51:23 +1000 (Sun, 05 Oct 2008)
>
> cameronbraid@beast:grub2$ uname -a
> Linux beast 2.6.24-19-generic #1 SMP Wed Aug 20 17:53:40 UTC 2008  
> x86_64 GNU/Linux
>
> Compiles fine for me
>
> Cameron
>
>
>
>
> James
>
> -----Original Message-----
> From: jidanni@jidanni.org
> Sent: Wednesday, October 15, 2008 2:41 PM
> To: grub-devel@gnu.org
> Subject: Re: forgot passwd, cannot login, [rd]init=/bin/sh don't work
>
> Can somebody please integrate my patches? For the parent article and
> the "grub-install message should mention --recheck" article.
>
> I am a mere "apt-get install" user. I fear if I learn your whole
> source code system, and finally make an official patch, it too will
> fall on deaf ears.
>
> As I expect I will only have one patch per three years, please
> integrate it for me. Thanks.
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
>
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel

[-- Attachment #2: Type: text/html, Size: 4939 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2008-10-18 12:20 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <4728c15d0810081751i57cfe910x9aa321f25f89495a@mail.gmail.com>
2008-10-09  1:09 ` forgot passwd, cannot login, [rd]init=/bin/sh don't work jidanni
2008-10-17 12:26 James Shewey
2008-10-18  3:44 ` Cameron Braid
2008-10-18 12:20   ` Steven Trotter
     [not found] <20081007095652.GD7127@fencepost.gnu.org>
2008-10-08 21:40 ` jidanni
2008-10-08 23:09   ` walt
2008-10-09 18:19   ` Niels Böhm
2008-10-11  2:46     ` jidanni
2008-10-15 18:41       ` jidanni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.