In Linux, how does one modify the password of the root user?
In Linux, the root account is a very important account and the account with the highest permissions. But what if I forget the root password? You cannot reinstall the system. This is the best practice. In Linux, if you forget the root account password, you can change the password in single-user mode or other methods. Of course, the specific method has something to do with Boot Loader and the operating system. GRUB and LILO have different implementation methods. Boot Loader is a small program that runs before the operating system kernel runs. Through this small program, we can initialize hardware devices and build a map of memory space to bring the system's hardware and software environment to a suitable state, in order to prepare the correct environment for the final call to the operating system kernel. Next we will introduce how to change the root account password when I forget the root password in Red Hat Enterprise Linux 5: forcibly restart the Linux system and go to the following interface. you can press the up/down key, select an option and press "e.
Go to the GRUP interface below
Select the second one and press the e key,
Press the cursor to the left to go down, add single to the front of ro or root, press the Enter key, and then press the "B" key to start the Linux system to enter the single user mode
Enter passwd root to modify
After setting the new password, run the restart command to restart the system.