including the root PW held on the SOC
Technically passwords are not stored anywhere. Point being, if you have privileged access to the root filesystem, you can remove or replace a password without having to know what it is, and without the system running (eg., if you put the SD card in another computer):
How can we change root password?
However, there is no means of recovering a forgotten password because, once again, it isn't actually stored anywhere.
Raspberry Pi OS (like most Debian OS) does not have a root password.
To elaborate on some of the material from the other links and clarify a possible point of confusion, there are two "user with no password" scenarios, depending on what's in /etc/shadow
.
The default entry for root on Raspbian/RpiOS:
root:*:18297:0:99999:7:::
The second field is an asterisk, and as per man 5 shadow
, "the user will not be able to use a unix password to log in" (and there are no other ways to log in on a default Pi). However, if the second field were empty:
root::18297:0:99999:7:::
Then "no passwords are required to authenticate as the specified login name" (just hit enter when asked for one). This is the trick used in the Unix & Linux exchange answer linked above.