Root password on a Raspberry Pi: login as superuser su!
04/06/2018 (28117x read)
To start your Paspberry Pi you’ll need a password in most cases: The username is „pi“ and the password „raspberry“. But for some actions your normal user rights are not enough to change or edit some system files: therefore you have to be „root“ or „super-user“.
Raspberry Pi root password: When user „pi“ is not enough!
Some actions on the Raspberr Pi require more than the normal user-rights of the pi user: To edt the configuration files or to delete other files, that are not in your user’s directory. To become „super user“ (su) or „root“ you just have to type „sudo su“ and press enter. If you forget the „sudo“, the Raspberry Pi will now ask for the root password:
su Password:
If you didn’t change the super-user’s password, it is still empty: the raspberry Pi just doesn’t have a root password – it will prompt you with the error message: „su: Authentication failure“, no matter which password you enter. To log in as root, just enter „sudo su“ and press the enter key without a password. After that you are „root user“ or „super user“ with all the needed rights on your Linux system.
Activate root rights with „sudo“
If you only need the root user’s rights once (e.g. to reboot the pc or to edit just one config-file), you can use „sudo“ as an alternative: This grants you the same rights as if you were a super user / root:
sudo reboot
or:
sudo nano /config.txt
Open a root shall to have super user rights
Another posibility is to open a new shell with root user’s rights to work with: You then don’t have to enter „sudo“ everytime you want to enter a command: By opening the new bash shell with sudo rights, you automatically have the rights of a root user in that shell window:
sudo bash
Enter a new root password on a Raspberry Pi
To make the Pi more secure, you can enter your own root user password: Just choose a new password that’s only for the root user (su). You can change to the root user afterwards by entering „su“ – the Pi will now ask you for the root user’s password.
First, log in as root user „su“:
sudo su
You don’t need a password for that! To change this and have the Raspberry ask you for a password the next time, enter the command „passwd“ and choose a new root password: