Follow this article for detailed guidance on using Raspberry Pi as a root user at boot.
Log in as Root User on Raspberry Pi at Boot
To log in as a root user at boot, go through the below-given steps:
Step 1: Open Raspberry Pi configuration using the following command:
Step 2: Go to the “Boot/Auto Login” option in the “System Options” section.
Step 3: Select the “Desktop” mode that requires the user to log in to Raspberry Pi credentials to log in to the system.
Reboot the system, choose the “Other” option, and enter the root as username and password.
Note: If you forgot the root password, you could change it by entering as a root user in the Raspberry Pi terminal and entering the command “passwd” to set a new password for the root user.
Click the “Log In” button to log in to the Raspberry Pi system as a root user.
On the desktop screen, you won’t be able to access the Raspberry Pi desktop, but you can perform the terminal-related tasks by opening the terminal using “CTRL+ALT+T”.
At this point, you have successfully entered as a root user on the Raspberry Pi system.
Conclusion
Root users can gain complete power over the system and run files and terminal-related commands. They can quickly enter the Raspberry Pi system as a root user at the boot by enabling the Login screen mode through the “raspi-config” command. After that, they must reboot the device and log in to the Raspberry Pi system using the username “root” with the default root password.