Linux---hack root password

Source: Internet
Author: User
Tags account security

for the network security has been our goal, large to the enterprise database security, small to personal account security, so we all need password (that is, password). In daily life and production, for, QQ, we can get back through the mobile phone message, then if we are a Linux administrator or user, when you forget the account password or someone else to modify it, how do we do? Here's a detailed list of CentOS 6 and CentOS 7.


One, the password to crack CentOS 6

Phenomenon: Unable to enter the system

Scenario: Enter single-user mode through rescue mode, crack password

Step: 1, restart after the countdown to read the second is to press any key to enter the menu page


650) this.width=650; "Src=" Http://upload-images.jianshu.io/upload_images/6908438-b53b3c8a93d9dbbd.png?imageMogr2 /auto-orient/strip%7cimageview2/2/w/1240 "style=" height:auto;vertical-align:middle;border:0px; "alt=" 1240 "/>

where e means editing; a means modifying kernel parameters; C means opening a command line

2, the upper and lower key to select the kernel parameter kernel, press the E key to enter the editing mode


650) this.width=650; "Src=" Http://upload-images.jianshu.io/upload_images/6908438-9de7dc44d032676c.png?imageMogr2 /auto-orient/strip%7cimageview2/2/w/1240 "style=" height:auto;vertical-align:middle;border:0px; "alt=" 1240 "/>

3, add a 1 on the last side of the parameter, enter the 1 boot level (that is, single user mode), then press ESC to return to the previous level, B key to start


650) this.width=650; "Src=" Http://upload-images.jianshu.io/upload_images/6908438-3ae74dee35fd2d23.png?imageMogr2 /auto-orient/strip%7cimageview2/2/w/1240 "style=" height:auto;vertical-align:middle;border:0px; "alt=" 1240 "/>

Note: As this is a temporary modification and enter the mode, only the B key can be started to take effect.

4. Change password after entering single user


650) this.width=650; "Src=" Http://upload-images.jianshu.io/upload_images/6908438-88a5410131b5fd40.png?imageMogr2 /auto-orient/strip%7cimageview2/2/w/1240 "style=" height:auto;vertical-align:middle;border:0px; "alt=" 1240 "/>

Second, the password to crack CentOS 7

Due to the different versions, there are significant changes in CentOS 7, because the system has SYSTEMD control, the original commands and parameters are almost unusable, so there is no single user mode in the CentOS 7 collection.

Phenomenon: No access to the system like CentOS 6

Scenario: password is cracked via kernel boot entry

Step: Method One: 1, press any key to pause at startup, select the line where the kernel is located by pressing the UP and DOWN ARROW keys


650) this.width=650; "Src=" Http://upload-images.jianshu.io/upload_images/6908438-f86e091a41574d75.jpg?imageMogr2 /auto-orient/strip%7cimageview2/2/w/1240 "style=" height:auto;vertical-align:middle;border:0px; "alt=" 1240 "/>

2, press E to enter the editing mode, move the cursor linux16 start line, add kernel parameters Rd.break


650) this.width=650; "Src=" Http://upload-images.jianshu.io/upload_images/6908438-d8c76fed7c278d7a.jpg?imageMogr2 /auto-orient/strip%7cimageview2/2/w/1240 "style=" height:auto;vertical-align:middle;border:0px; "alt=" 1240 "/>


650) this.width=650; "Src=" Http://upload-images.jianshu.io/upload_images/6908438-fc036d2a69157ecf.jpg?imageMogr2 /auto-orient/strip%7cimageview2/2/w/1240 "style=" height:auto;vertical-align:middle;border:0px; "alt=" 1240 "/>

3, press Ctrl+x start, the following tips, and here is not like CentOS 6 can be used to start the B. Use the Mount option to discover that the root partition is mounted in a system mode


650) this.width=650; "Src=" Http://upload-images.jianshu.io/upload_images/6908438-8e38ab2960926cc2.jpg?imageMogr2 /auto-orient/strip%7cimageview2/2/w/1240 "style=" height:auto;vertical-align:middle;border:0px; "alt=" 1240 "/>

After entering the command line, perform the operation to implement the password modification

① re-mount the root partition in RW mode. Execute Mount–o remount,rw/sysroot

② switch root partition, change root password, create tag file, restart

650) this.width=650; "Src=" Http://upload-images.jianshu.io/upload_images/6908438-c8b34f6dcd9af7b4.jpg?imageMogr2 /auto-orient/strip%7cimageview2/2/w/1240 "style=" height:auto;vertical-align:middle;border:0px; "alt=" 1240 "/>

Method Two: When modifying the startup parameters to specify the initialization process for bash, go to bash to change the root password, similarly, CentOS6 can also use this way to modify the password (RW init=/sysroot/bin/sh) steps are as follows:

1. Press any key at startup to pause start, select the line where the kernel is located by pressing the UP and DOWN ARROW keys


650) this.width=650; "Src=" Http://upload-images.jianshu.io/upload_images/6908438-63965b303406a609.jpg?imageMogr2 /auto-orient/strip%7cimageview2/2/w/1240 "style=" height:auto;vertical-align:middle;border:0px; "alt=" 1240 "/>

2, press E to enter the editing mode, move the cursor linux16 start line, at the end plus RW init=/sysroot/bin/sh


650) this.width=650; "Src=" Http://upload-images.jianshu.io/upload_images/6908438-f0523596d6cb8b6c.jpg?imageMogr2 /auto-orient/strip%7cimageview2/2/w/1240 "style=" height:auto;vertical-align:middle;border:0px; "alt=" 1240 "/>


650) this.width=650; "Src=" Http://upload-images.jianshu.io/upload_images/6908438-3004c0094b645631.jpg?imageMogr2 /auto-orient/strip%7cimageview2/2/w/1240 "style=" height:auto;vertical-align:middle;border:0px; "alt=" 1240 "/>

3, press Ctrl+x start, the following tips, and here is not like CentOS 6 can be used to start the B. Because it is RW mode mount, so direct cutting root, change password, create a tag file, and then restart

① re-mount the root partition in RW mode. Execute Mount–o remount,rw/sysroot

② switch root partition, change root password, create tag file, restart

650) this.width=650; "Src=" Http://upload-images.jianshu.io/upload_images/6908438-c6346276b2bc0ae0.jpg?imageMogr2 /auto-orient/strip%7cimageview2/2/w/1240 "style=" height:auto;vertical-align:middle;border:0px; "alt=" 1240 "/>

This article introduces the way to crack the root password, I hope you can learn from it, thank you! 650) this.width=650; "src=" Http://img.baidu.com/hi/jx2/j_0063.gif "alt=" J_0063.gif "/>650" this.width=650; "src=" Http://img.baidu.com/hi/jx2/j_0063.gif "alt=" J_0063.gif "/>


Linux---hack 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.