Solve Linux root password retrieval

Source: Internet
Author: User

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.

  1. Solve Linux garbled characters
  2. Introduction to Linux Log Files
  3. Linux link file type
  4. Comprehensive Analysis of Linux clock
  5. Detailed introduction to the use of Linux redirection
>

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.