Easy Tutorial
❮ Linux Comm Export Linux Comm Quotaon ❯

Linux Forgot Password Solution

Many friends often forget the root password of the Linux system. What should you do if you forget the root password of the Linux system? Reinstall the system? Of course not! Just enter single-user mode and change the root password.

Steps are as follows:

Restart the Linux system

Within 3 seconds, press Enter to see the following interface.

Then type "e".

At the end of the second line, enter "single", with a space. Specifically, move down to the second line with the arrow key and press "e" to edit.

Add "single" at the end and press Enter.

Finally, press "b" to start. Once started, you will enter single-user mode.

At this point, you are in single-user mode and can change the root password. The command to change the password is "passwd".

Using the Rescue Mode of the System Installation Disk

Rescue mode, or rescue, is mainly used when the system cannot be accessed. For example, if GRUB is damaged or a configuration file is modified incorrectly. How to use rescue mode?

Boot from the CD and press F5 to enter rescue mode.

Type "linux rescue" and press Enter.

Select the language; it is recommended to choose English.

Select the US keyboard.

Here, you are asked whether to enable the network. Sometimes you might need to debug online. We choose "no".

You are told that the system will be mounted at /mnt/sysimage.

There are three options:

We choose Continue.

At this point, the system is mounted at /mnt/sysimage. Press Enter and type "chroot /mnt/sysimage" to enter the administrator environment.

Note: It is also possible to change the root password in rescue mode. This rescue mode is similar to the Windows PE system.

After running "chroot /mnt/sysimage/", you can use "ls" to see the directory structure is the same as the original system.

Yes! The current environment is identical to the original system environment. You can type "exit" or press Ctrl + D to exit this environment. Then use "ls" to see the directory structure.

This directory structure is from the rescue mode, and all our system files are in the /mnt/sysimage directory.

❮ Linux Comm Export Linux Comm Quotaon ❯