Break through the root user through Gurb

Source: Internet
Author: User
Break through the root user-general Linux technology-Linux technology and application information through Gurb. The following is a detailed description. Let's talk about the settings of my grub, as follows:

Default = 1
Timeout = 10
Splashimage = (hd0, 2)/grub/splash.xpm.gz
Hiddenmenu
Title Fedora
Root (hd0, 2)
Kernel/vmlinuz-2.6.23.1-42.fc8 ro root =/dev/VolGroup00/LogVol00 rhgb quiet
Initrd/initrd-2.6.23.1-42.fc8.img
Title Windows
Rootnoverify (hd0, 0)
Chainloader + 1

Enable the computer. On the gurb Boot Loader menu, select Fedora and type [e] to enter the editing mode.

A list of pilot projects is displayed. Find the following output sentence lines:
Kernel/vmlinuz-2.6.23.1-42.fc8 ro root =/dev/VolGroup00/LogVol00 rhgb quiet

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 for a single user.

Press the [Enter] key to 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 will face a shell prompt similar to the following: sh-3.2 #

The single-user mode is equivalent to the Windows security mode. Only the root user has "#"!

Sh-3.2 # vi/etc/passwd

Only the first line in passwd is mentioned here.
Root: x: 0: 0: root:/bin/bash

Here, "x" indicates that the root password is removed from "x" and changed
Root: 0: 0: root:/bin/bash

Sh-3.2 # vi/etc/shadow

Similarly, modify the first line in shadow.
Root: $1 $ 3YjH4woI $ 49jmwaejd9roj1_g3yo7j.: 13928: 0: 99999: 7 :::

Remove the root password and change it
Root: 13928: 0: 99999: 7 :::

When you exit, you must use wq!

In this way, the root user has no password. Starting from the computer, it broke through the root user.
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.