Linux root password retrieval

Source: Internet
Author: User

Linux root password retrieval
"I forgot my CentOS (Linux) root password. What should I do? You can change the root password in single-user mode. "Sometimes, when we forget the Linux system administrator password, we can reset the root password locally by entering the single-user mode.
Www.2cto.com for CentOS 5. in Version x, there are many ways to enter the single-user mode. The main operations are performed when you enter the grub Startup menu. Below are two commonly used methods: Method 1: press "a" to enter the single-user mode.
Www.2cto.com is the quickest way to enter the single-user mode. In the GRUB Startup menu, use the "a" operation button to edit the kernel Parameter and enter single at the end of the line to tell the Linux kernel to enter single-user mode during startup, and press Enter. Method 1: Press "e" to enter the single-user mode. In the GRUB boot menu, use the "e" operation button to enter the CentOS boot menu to the interface, move the cursor to the "kernel" configuration item line, and locate the cursor to the kernel menu item, then press the "e" key to edit the "kernel" menu item and enter single at the end of the line to tell the Linux kernel that the subsequent startup process needs to enter the single user mode. Then press enter to return to the Startup menu selection interface. Then, based on the prompts on the screen, press "B" to start the system with the menu option you just edited, and then enter the single-user mode. When entering the single user name mode, the system does not need password verification, and the root permission is obtained directly. There is a key piece of information during the startup process: Remounting root filesystem in read-write mode: [OK] indicates that the system root directory has the permission to read and modify the file, in this way, we can use commands to perform some operations, such as resetting the root password, managing partitions and backing up data. Next let's talk about resetting the root password: Enter the command passwd and press Enter. At this time, the system will prompt you to enter a new password, enter the new password, press enter, and then enter the new password again, then press enter to make the modification successful. Then enter the reboot command to restart the system. After the system starts up, you can use the password you just modified to remotely log on to the system.
Note: In single-user mode, the network is not started, so it cannot be remotely connected.

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.