Linux Learning (Four) Forgot your password solution

Many of my friends often forget the case of Linux system root password, linux system root password forgotten how to do it? Reinstall the system? Of course not! Single-user mode change my root password.

Proceed as follows:

Linux system reboot

 

 3 seconds to click the Enter, the following interface

 

 Then e

 

 In the second line of the last input side single, a space. Specific methods are moved downwardly to press the tip of the second row, press "e" to enter the edit mode

 

 Behind plus single carriage return

 

 Finally, press the "b" starts, after the boot into single-user mode

 

 At this time, has entered into single-user mode, you can change the root password. More password command passwd

 

 

[ Use rescue mode system installation CD-ROM ]

Rescue mode, ie rescue, this model is mainly used in, the system can not enter. Such as, grub damage or a certain profile modification error. How to use the rescue mode it?

CD-ROM, press F5 to enter rescue mode

 

 Enter input linux rescue

 

 Select the language, I suggest you choose English

 

 Choose us keyboard

 

 

 

 Here ask if you start the network, sometimes things might debugging. We choose no

 

 

Here to tell us, then the system will be mounted in / mnt / sysimage in.

There are three options:

  • Continue to the next step is to mount the rear. 
  • Read-Only mount read-only, which is more secure, and sometimes when the file system is damaged, read-only file system prevents damage to the closer.
  • Skip is not mounted, enter a command window mode. 

Here we select Continue.

 

 So far, the system has been mounted to / mnt / sysimage in. Next enter, enter chroot / mnt / sysimage enter the administrator environment.

 

 

Tip:  In fact, you can also go to the next rescue mode to change the root password. The rescue mode and windows PE system is very similar.

When running chroot / mnt / sysimage /, then ls to see the directory structure of the original system is the same.

没错!现在的环境和原来系统的环境是一模一样的。你可以输入exit 或者按Ctrl + D退出这个环境。然后你再ls 看一下

 

 这个目录其实就是rescue模式下的目录结构,而我们的系统文件全部在 /mnt/sysimage目录下。

Guess you like

Origin www.cnblogs.com/qingmuchuanqi48/p/12064610.html