Solution to linux/CentOS 6 forgetting the root password: centosroot

Source: Internet
Author: User

Solution to linux/CentOS 6 forgetting the root password: centosroot

When using linux, you may sometimes forget the password of the root user (especially when the document content is incomplete during the handover ), at this time, we can enter single-user mode to reset the root user password. The following describes how to reset the root password, or how to crack the root password.


System Environment: centos6.5 mini


1. Restart the server. When you press any key during the second reading, the following interface will appear:

In this interface, press 'e' on the keyboard to enter grub mode.




2. Press e in step 1 to enter the following interface.

Move the cursor to the line of the kernel, and then press 'E' again to enter the edit interface of the line of the kernel.




3. This is the kernel editing interface.




4. On the kernel editing page, click the Space key, enter single at the end, and press enter to exit the kernel editing page.




5. Exit the kernel interface and return to the grub mode interface. On this interface, move the cursor to the line of the kernel again, and then press 'B' to start the system.




6. At this time, the system will get up to the single-user mode. You can directly access the system without entering any password.




7. In single-user mode, we can change the password directly.



8. After the modification is completed, restart the server to enter the normal mode.



How to crack centos 60 root Password in linux

Crack the root password of centos:
If you forget the root password, try the following method.
When the system enters grub, the system menu will appear. Press the "e" Key (e here stands for edit ).
The screen will jump to another screen, there are several options, please choose to module/vmlinux-2.6.20... 'Option at the beginning, press the "e" key to edit the option. If the option is too long, right-click the option and you will see the remaining part of the item.
Add the word single in front of ro (separated by spaces before and after single)
Press OK, and then press "B" (B here represents boot)
The system enters single mode.
The shell_3.2 # prompt is displayed:
Enter cp/etc/passwd/etc/passwd_back
Vi/etc/passwd (Basic vi operations should be performed)
Set the root: x: 0: 0… of the first line ..... Change to root: 0: 0... (Delete x)
Input # reboot
Restart the machine.

What should I do if the root password of linux centos is lost?

GRUB: On the boot loader menu, type [e] to enter the editing mode.
You will face a list of pilot projects. Find the following output sentence lines:
Kernel/vmlinuz-2.4.18-0.4 ro root =/dev/hda2

Press the arrow keys until the line is highlighted and then press [e].
Now you can add a single entry at the end of the text to tell GRUB to guide the Linux mode of a single user. Press [Enter ].
Make the editing result take effect.
You will be taken with the edit mode screen. From here, press [B] and GRUB will guide the single-user Linux mode. After loading, you
A shell prompt similar to the following is displayed:
Sh-2.05 #

Now, you can change the root command and type:

Bash # passwd root
You will be asked to retype the password for verification. The password will be changed. You can enter reboot at the prompt to re-import
Then, log on as the root user as usual.

LILO: when the system starts to display the LILO boot screen, press TAB for the graphic Boot Mode to enter the text mode, and then click
Location

Enter linux single press enter to enter the password-free console, and then use the passwd command to change the root password
You can.

Related Article

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.