...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.
Didn't find your answer? Ask the community — no account required.
C
Computer Nerd Kev
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.
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.
R
Richard Kettlewell
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:
formatting link
formatting link
formatting link
T
The Natural Philosopher
You are never presented with an option to enter a name, only the root password
T
The Natural Philosopher
yes.
ah.
how? the machine is inaccessible
if you knew what to edit...
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,.
T
Theo
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
C
Computer Nerd Kev
Edit cmdline.txt on the MicroSD card with a PC.
cmdline.txt, on the FAT partition. There's no Grub-style interactive boot prompt, so you do need to edit the file.
Join the Discussion
Have something to add? Share your thoughts — no account required.
Didn't find your answer?
Ask the community — no account required
Report Content
You are reporting this content to the moderators. They will look at it
ASAP.