Forgot the Ubuntu root password solution

  

Ubuntu forgot your password, forgot your root password? Although it is a small probability event, it can still happen. So, what do we do when we forget to forget the Ubuntu root password? Let's take a look at the solution given by Principal Ubuntu.

Ubuntu's root is forbidden by default. It is not required to set the root password during installation. It is different from the Red Hat system series here. To use root under Ubuntu, we can use the terminal to set the password for root

sudo passwd root If you just forget the ordinary user password, you can modify it with root. If root is forgotten, it goes into single-user mode, which is different from the Red Hat system series.

The specific method is as follows:

Enter single user mode:

#1, when booting into grub, use the up and down keys to move to the recovery mode of the second line, press e ( Note that it is not a carriage return)

#2,

Change ro single to rw single init=/bin/bash, then press ctrl+x to enter single-user mode, go in and do anything okay. (Going in is the command line, so you have to understand the command line!) We can modify the normal user password, or change the root password. Prompt, after completion, press ”ctrl+alt+delete“ combination god key to restart (I tried to use the command to shut down, restart will not work, can only use this).

These are all tried and successful, you can try it! I have seen some online methods and tried them. It is not acceptable! Some are using the Red Hat system series, some are wrong!

To change the password of a normal user, the command is in the following format:

passwd username

Copyright © Windows knowledge All Rights Reserved