Change Root Password on Raspberry Pi
To change the root password on Raspberry Pi, go through the following steps:
Step 1: Open the Raspberry Pi terminal using “CTRL+ALT+T” and enter the following command to log in to root users on the terminal:
Alternatively, you can also use the following command to enter the Raspberry Pi as a root user.
The main difference between the above commands is that users have to use the “-i” command if the account is protected by a password, while they can use “su” without any protection.
Step 2: Now, through the following command, you can set the root password on Raspberry Pi:
Step 3: Write the “New password” for the root user.
Step 4: Add the same password again to confirm adding the new password successfully on the Raspberry Pi system.
Step 5: Once the password is set, run the “exit” command.
Optional: You can also use the following direct command in the terminal to change the root password for your Raspberry Pi system.
In this way, you can change the root password for Raspberry Pi if you don’t remember your previous password.
Conclusion
You can easily change the root password on Raspberry Pi by entering the Raspberry Pi terminal as a root user and running the “-i” or “su” command. After that, hit the “passwd root” command to confirm adding a new password for the root user. Alternatively, you can use the “passwd root” command to directly change the root password on the Raspberry Pi system without login into the Raspberry Pi system as a root user.