How to Change the Default Root Password in Ubuntu

After installing Ubuntu, I suddenly realized I hadn’t set a root password. Without knowing the password, naturally I couldn’t access the root user. I searched online and here’s how it works. Ubuntu’s default root password is random — meaning a new root password is generated each time the system boots. We can open the terminal and enter the command sudo passwd, then enter the current user’s password, press enter. The terminal will prompt us to enter a new password and confirm it — this password then becomes the new root password. After the change is successful, enter the command su root, input the new password, and you’re all set.

Leave a Comment

Your email address will not be published.