Fix the Linux Root Password

Source: Internet
Author: User
Article Title: fix the Linux Root Password. Linux is a technology channel of the IT lab in China. Including desktop applications, Linux system management, kernel research, embedded systems, open source, and other basic categories. If you forget the root password, you cannot log on to the system, please try the following method to change the forgotten 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, the linux single-user mode can be started, which is a bit similar to the windows security mode, that is, 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). the login 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.
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.