On Ubuntu 20.04, the root user account is locked by default to enhance system security. While administrative tasks are typically performed using the sudo command, there are times when direct root access is necessary, such as when recovering from system issues or performing specific administrative tasks that require root privileges. This guide will show you how to change or reset the root password, even if you don’t have sudo access.
Resetting the root password from GRUB
If you’ve forgotten your root password or don’t have sudo access, you can reset the root password by modifying the boot process from the GRUB menu. Follow these steps to reset the root password through GRUB.
Shift key immediately after the BIOS screen to force it to display.

linux, which is usually the second-to-last line. Look for the terms quiet splash at the end of this line and replace them with rw init=/bin/bash. This modification tells the system to boot into a writable shell prompt as the root user instead of the graphical interface.
F10 to boot with the modified parameters. The system will now boot into a root shell without prompting for a password.
passwd

reboot or by pressing the reset button. Your system will boot normally, and you can now log in as root using the new password.Join readers who trust AllThings.How
Add us as a preferred source on Google so our practical guides show up first next time you search.
Add to Google Preferences →Changing the root password with sudo access
If you have a user account with sudo privileges, you can set or change the root password directly from the terminal. This method requires that your user is permitted to use the su command through sudo.
sudo su

The prompt should now change to indicate that you are operating as the root user.
passwd command. You’ll be asked to enter a new password for the root account and then confirm it.passwd

The root password is now set or updated to the new password you provided.
Ctrl + D. Then, attempt to log in as root by typing su and entering the new root password when prompted.su

You should now be logged in as the root user with the new password, confirming that the password change was successful.
Changing or resetting the root password on Ubuntu 20.04 can be accomplished with or without sudo access, depending on your circumstances. Always use the root account cautiously, as it has unrestricted access to your system and can affect critical components.






