BBS:      TELESC.NET.BR
Assunto:  Re: Why you need a root password
De:       The Natural Philosopher
Data:     Thu, 26 Mar 2026 07:14:47 +0000
-----------------------------------------------------------
On 25/03/2026 23:25, Richard Kettlewell wrote:
> not@telling.you.invalid (Computer Nerd Kev) writes:
>> The Natural Philosopher  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)

-----------------------------------------------------------
[Voltar]