Article title: Linux Root password for security repair. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
If you cannot log on to the system because you forgot the root password, try the following methods to change the root password:
Method 1:
1. restart the system. When the system starts to the grub or lilo (usually grub) boot menu, find the current boot item of the system (you can press the arrow key to expand the hidden menu );
2. position the cursor on the option and press the "e" Key to enter the editing status of the guide;
3. this option has three lines of statements. use the cursor to select the second line, that is, the line starting with "Kernel;
4. press "e" on this line to enter the editing status of this line;
5. add a space at the end of the row and write the number 1, similar to this:
Kernel/boot/vmlinuz-2.6.9-11.19 ro root = LABEL =/1
6. after modification, press "enter" to return to the original interface;
7. press the "B" key to start the guide.
In this way, you can start the linux single user mode, a bit similar to windows security style = "COLOR: #000000" href = "http://safe.it168.com/" target = _ blank> Security mode, only the most basic system is started, and network services and system services are not started. After the single-user mode guide is complete, a # prompt will be displayed, indicating that you already have super user permissions. then, run the following command after:
/Usr/bin/passwd
The system should prompt you to enter the password. this password is not displayed and must be entered correctly. after you press enter, the system will ask you to enter it again. The input requirements are consistent, then you will see the prompt that the password is successfully modified. Enter the command init 3 and enter the system character interface mode (the system will change the running level again ). Login: the prompt is displayed. try again to see if you can log on with the root account and the modified password.
Method 2:
1. Insert the first optical disc into the optical drive and restart the system. after the boot is successful from the optical drive, enter linux rescue and press enter.
2. follow the bootstrap program to go down without configuring the network. However, if you want to manually mount the system partition and select "yes", the system will go to the "#" prompt.
3. run the command chroot/mnt/sysimage/(the default system will be in the/mnt/sysimage/directory)
4. run/usr/bin/passwd to modify the root password.
5. execute the command exit, remove the disc, and restart the system. Then, log on to the system with a new password. You can fix the root password.