If you forget the root password, you must reinstall the entire machine. Even worse, many people will do this. However, it is very easy to start the machine and change the password. This is not applicable in all cases, such as setting a GRUB Password, but also forgetting). But here is an example of Cent OS Linux, which describes the general operations.
First, restart the system. The GRUB screen shown in 1 is displayed when the instance is restarted. Move the arrow keys to keep them on this screen instead of starting properly.
Figure 1. GRUB screen after restart
Then, use the arrow keys to select the kernel to be started and enterEEdit the kernel line. Then you can see the screen shown in 2:
Figure 2: Prepare to edit the kernel line
Use the arrow keys again to highlightkernelStart row, pressEEdit kernel parameters. When the Screen 3 is reached, append the number 1 after the parameters shown in Figure 3:
Figure 3. append the number 1 after the Parameter
Then pressEnterAndBThe kernel is started to single-user mode. Then runpasswdCommand to change the user root password:
sh-3.00# passwd
New UNIX password:
Retype new UNIX password:
passwd: all authentication tokens updated successfully
Now you can restart the instance. The machine will start with a new password.
- Solve Linux garbled characters
- Introduction to Linux Log Files
- Linux link file type
- Comprehensive Analysis of Linux clock
- Detailed introduction to the use of Linux redirection
>