• Re: Why you need a root password

    From Computer Nerd Kev@3:633/10 to All on Thu Mar 26 08:20:43 2026
    The Natural Philosopher <tnp@invalid.invalid> wrote:
    ...if your system fails to boot and you end up in maintenance mode there
    is no way out except use of the root login and password...

    Strange, if it can read the root password hash from storage, why
    can't it read the other ones? Does RPi OS it store that password in
    the initrd but not the other ones? When they can't mount the root
    filesystem, I remember other Linux distros going to a command prompt
    without asking for a password, though I haven't seen what RPi OS
    does.

    And if its a Pi zero you have to buy adapters to plug in a USB keyboard
    to enter it on and an HDMI monitor to see what is going on.

    A quick and cheap alternative is to cut a USB extension cable or
    a lead from an old PC USB socket back-panel and solder it to the
    test points with the USB signals on the bottom of the Pi Zero's
    circuit board. For the monitor, solder wires or a header to the
    composite video output which can be enabled in config.txt.

    --
    __ __
    #_ < |\| |< _#

    --- PyGate Linux v1.5.13
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From The Natural Philosopher@3:633/10 to All on Wed Mar 25 13:49:08 2026
    ...if your system fails to boot and you end up in maintenance mode there
    is no way out except use of the root login and password...

    And if its a Pi zero you have to buy adapters to plug in a USB keyboard
    to enter it on and an HDMI monitor to see what is going on.



    --
    ?The urge to save humanity is almost always only a false face for the
    urge to rule it.?
    ? H. L. Mencken

    --- PyGate Linux v1.5.13
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Richard Kettlewell@3:633/10 to All on Wed Mar 25 23:25:37 2026
    not@telling.you.invalid (Computer Nerd Kev) writes:
    The Natural Philosopher <tnp@invalid.invalid> wrote:
    ...if your system fails to boot and you end up in maintenance mode
    there is no way out except use of the root login and password...

    Strange, if it can read the root password hash from storage, why
    can't it read the other ones? Does RPi OS it store that password in
    the initrd but not the other ones? When they can't mount the root
    filesystem, I remember other Linux distros going to a command prompt
    without asking for a password, though I haven't seen what RPi OS
    does.

    I think TNP is seeing the emergency.service unit, which is run under
    certain boot failure conditions. The effect is to run sulogin, which
    normally requests the root password.

    AFAICT if there is no root password set, sulogin will give you a root
    shell without requesting any authentication.

    Even if that doesn?t go as expected, you can edit the kernel command
    line to point init at a shell, which will then run without any tedious
    business with passwords, as long as it actually exists. So, there?s
    definitely another way.

    On an x86 device running Grub you can do this easily in the boot-time
    UI. I don?t know if there?s an interactive way to do it on any Pi models
    but in the worst case you could mount the SD card with another computer
    and edit the kernel command line.

    If boot fails before / is mounted then I think you get an initramfs
    shell, without any authentication. Certainly my initramfs doesn?t
    include any password hashes. I don?t feel like doing the experiment l-)

    References:

    https://man7.org/linux/man-pages/man7/systemd.special.7.html
    https://man7.org/linux/man-pages/man8/sulogin.8.html
    https://github.com/util-linux/util-linux/blob/master/login-utils/sulogin.c

    --
    https://www.greenend.org.uk/rjk/

    --- PyGate Linux v1.5.13
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Theo@3:633/10 to All on Thu Mar 26 11:10:05 2026
    Richard Kettlewell <invalid@invalid.invalid> wrote:
    I think TNP is seeing the emergency.service unit, which is run under
    certain boot failure conditions. The effect is to run sulogin, which
    normally requests the root password.

    AFAICT if there is no root password set, sulogin will give you a root
    shell without requesting any authentication.

    Yes. Ubuntu doesn't set a root password, so when you get that prompt to
    enter the root password for maintenance you can just press Enter and you're
    in.

    Theo

    --- PyGate Linux v1.5.13
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From The Natural Philosopher@3:633/10 to All on Thu Mar 26 07:14:47 2026
    On 25/03/2026 23:25, Richard Kettlewell wrote:
    not@telling.you.invalid (Computer Nerd Kev) writes:
    The Natural Philosopher <tnp@invalid.invalid> wrote:
    ...if your system fails to boot and you end up in maintenance mode
    there is no way out except use of the root login and password...

    Strange, if it can read the root password hash from storage, why
    can't it read the other ones? Does RPi OS it store that password in
    the initrd but not the other ones? When they can't mount the root
    filesystem, I remember other Linux distros going to a command prompt
    without asking for a password, though I haven't seen what RPi OS
    does.

    I think TNP is seeing the emergency.service unit, which is run under
    certain boot failure conditions. The effect is to run sulogin, which
    normally requests the root password.

    yes.

    AFAICT if there is no root password set, sulogin will give you a root
    shell without requesting any authentication.

    ah.

    Even if that doesn?t go as expected, you can edit the kernel command
    line to point init at a shell, which will then run without any tedious business with passwords, as long as it actually exists. So, there?s definitely another way.

    how? the machine is inaccessible

    On an x86 device running Grub you can do this easily in the boot-time
    UI. I don?t know if there?s an interactive way to do it on any Pi models
    but in the worst case you could mount the SD card with another computer
    and edit the kernel command line.

    if you knew what to edit...

    If boot fails before / is mounted then I think you get an initramfs
    shell, without any authentication. Certainly my initramfs doesn?t
    include any password hashes. I don?t feel like doing the experiment l-)

    The error was in fstab. I *think* it mounted /

    When I finally got in after buying the correct adapters, I was able to
    edit things till it booted,.


    References:

    https://man7.org/linux/man-pages/man7/systemd.special.7.html
    https://man7.org/linux/man-pages/man8/sulogin.8.html
    https://github.com/util-linux/util-linux/blob/master/login-utils/sulogin.c


    --
    Any fool can believe in principles - and most of them do!




    --- PyGate Linux v1.5.13
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From The Natural Philosopher@3:633/10 to All on Thu Mar 26 07:10:50 2026
    On 25/03/2026 22:20, Computer Nerd Kev wrote:
    Strange, if it can read the root password hash from storage, why
    can't it read the other ones?

    You are never presented with an option to enter a name, only the root
    password

    --
    Karl Marx said religion is the opium of the people.
    But Marxism is the crack cocaine.


    --- PyGate Linux v1.5.13
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Computer Nerd Kev@3:633/10 to All on Fri Mar 27 08:28:18 2026
    The Natural Philosopher <tnp@invalid.invalid> wrote:
    On 25/03/2026 23:25, Richard Kettlewell wrote:
    Even if that doesn't go as expected, you can edit the kernel command
    line to point init at a shell, which will then run without any tedious
    business with passwords, as long as it actually exists. So, there's
    definitely another way.

    how? the machine is inaccessible

    Edit cmdline.txt on the MicroSD card with a PC.

    On an x86 device running Grub you can do this easily in the boot-time
    UI. I don't know if there's an interactive way to do it on any Pi models
    but in the worst case you could mount the SD card with another computer
    and edit the kernel command line.

    if you knew what to edit...

    cmdline.txt, on the FAT partition. There's no Grub-style
    interactive boot prompt, so you do need to edit the file.

    --
    __ __
    #_ < |\| |< _#

    --- PyGate Linux v1.5.13
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)