To change the root password in Ubuntu, follow these steps:
- Open a terminal window or switch to a TTY console.
- Type
sudo passwd
and press enter. - Enter your current user password.
- Type the new root password and press enter.
- Re-enter the new root password to confirm.
The root password should now be changed.
Note: In Ubuntu, the root account is disabled by default for security reasons. It is recommended to use sudo
to perform administrative tasks instead of logging in as root.