Reset your root password locally under Linux (Centos, Ubuntu)

Source: Internet
Author: User

Retrieve root password locally from Linux (Centos, Ubuntu)

Speaking of the system password, perhaps the administrator is the most headache, if the internal service more, need to record a lot of passwords. Of course, do not rule out the possibility of forgetting the password, for the Windows system password forgot to retrieve the method, we have in the previous article has been introduced, in fact, through the old Peaches tool needs encapsulation to achieve Windows password cracking, but under Linux are not so troublesome, Only need to set in the local power-on option, today, we mainly introduce the two Linux versions commonly used in the daily work of the system for the root password forgot to retrieve the introduction, one is CentOS, the other is ubunut; see below:

The first is how to retrieve the root password under CentOS:

We first install a CentOS test:

650) this.width=650; "title=" clip_image001 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "border=" 0 "alt = "clip_image001" src= "http://s3.51cto.com/wyfs02/M00/56/A3/wKioL1SKXW3Dl68nAAMDcVvxygw569.jpg" height= "591"/>
Select the feature software to install

650) this.width=650; "title=" clip_image002 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "border=" 0 "alt = "clip_image002" src= "http://s3.51cto.com/wyfs02/M01/56/A3/wKioL1SKXW6RZR8-AAKDk25nRek709.jpg" height= "715"/>

Installation Complete

650) this.width=650; "title=" clip_image003 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "border=" 0 "alt = "clip_image003" src= "http://s3.51cto.com/wyfs02/M01/56/A6/wKiom1SKXNXBZs9NAAHDylFLHW0785.jpg" height= "704"/>

650) this.width=650; "title=" clip_image004 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "border=" 0 "alt = "clip_image004" src= "http://s3.51cto.com/wyfs02/M02/56/A6/wKiom1SKXNWzqfZqAAJLcxpR9Vw962.jpg" height= "518"/>

Start forgetting the CentOS root password back, after we restart the system, press ESC to enter the system options list, then we can see the current system information, then we press the E key ( Note: Not enter Oh )

650) this.width=650; "title=" clip_image005 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "border=" 0 "alt = "clip_image005" src= "http://s3.51cto.com/wyfs02/M00/56/A6/wKiom1SKXNWzBQuUAAHzJrs3Mic328.jpg" height= "604"/>

Then we select the second-kerneland then continue to press "E"

650) this.width=650; "title=" clip_image006 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "border=" 0 "alt = "clip_image006" src= "http://s3.51cto.com/wyfs02/M01/56/A6/wKiom1SKXNWw_ecXAAJQC2c0y4U464.jpg" height= "606"/>

Enter single or 1after RHGB quiet and return to

650) this.width=650; "title=" clip_image007 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "border=" 0 "alt = "clip_image007" src= "http://s3.51cto.com/wyfs02/M02/56/A6/wKiom1SKXNXhwiJ0AAHf7DK3aNc838.jpg" height= "/>"

Then return to the interface and press b to reboot the system .

650) this.width=650; "title=" clip_image008 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "border=" 0 "alt = "clip_image008" src= "http://s3.51cto.com/wyfs02/M00/56/A6/wKiom1SKXNayk3HZAAJNp2fjOgo486.jpg" height= "599"/>

After launch, we found that directly into the system, no need to enter the account and password

650) this.width=650; "title=" clip_image009 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "border=" 0 "alt = "clip_image009" src= "http://s3.51cto.com/wyfs02/M01/56/A6/wKiom1SKXNbRGbkNAAOPtS4EoIs481.jpg" height= "519"/>

After entering, we can change the password according to passwd root .

650) this.width=650; "title=" clip_image010 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "border=" 0 "alt = "clip_image010" src= "http://s3.51cto.com/wyfs02/M02/56/A6/wKiom1SKXNbAkAW_AANyqkFw5O0229.jpg" height= "521"/>

Second, the Ubuntu system root password back:

We still need to install an Ubuntu system

650) this.width=650; "title=" clip_image011 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "border=" 0 "alt = "clip_image011" src= "http://s3.51cto.com/wyfs02/M00/56/A6/wKiom1SKXNbSr93gAAGZMazOLPw662.jpg" height= "597"/>

Set host name

650) this.width=650; "title=" clip_image012 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "border=" 0 "alt = "clip_image012" src= "http://s3.51cto.com/wyfs02/M01/56/A6/wKiom1SKXNeDEfxwAAJGtT3jYD0579.jpg" height= "712"/>

System installation Complete, click Continue to reboot into the system

650) this.width=650; "title=" clip_image013 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "border=" 0 "alt = "clip_image013" src= "http://s3.51cto.com/wyfs02/M02/56/A6/wKiom1SKXNfgcKUJAAIEyp7z1Us229.jpg" height= "705"/>

After startup, enter the system via a custom account

650) this.width=650; "title=" clip_image014 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "border=" 0 "alt = "clip_image014" src= "Http://s3.51cto.com/wyfs02/M00/56/A6/wKiom1SKXNfCBNLgAAK_7aJDhV8367.jpg" height= "509"/>

Since the system is installed to customize the login user, and the system root account is not enabled by default, we need to switch to the root account, and then reset the root password, and then the root account to login

650) this.width=650; "title=" clip_image015 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "border=" 0 "alt = "clip_image015" src= "Http://s3.51cto.com/wyfs02/M01/56/A6/wKiom1SKXNeCm9NnAALVksJ2l6c178.jpg" height= "509"/>

Then we simulate the forgotten root password:

After rebooting the system we press ESC and then select the second advanced option for Ubunt and then press E (note: not carriage return OH)

650) this.width=650; "title=" clip_image016 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "border=" 0 "alt = "clip_image016" src= "http://s3.51cto.com/wyfs02/M02/56/A6/wKiom1SKXNfCj-LuAAIXRGKo2nA756.jpg" height= "595"/>

Then move through the cursor to the bottom, change the ro recovery nomodeset to RW single Init=/bin/bash

Then press ctrl+x or F10 to enter single-user mode

650) this.width=650; "title=" clip_image017 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "border=" 0 "alt = "clip_image017" src= "http://s3.51cto.com/wyfs02/M00/56/A6/wKiom1SKXNiSKanOAAMJOwySxOo613.jpg" height= "595"/>

Then ctrl+x or F10 return to the System Advanced option , then we select Restore Mode to enter into single user mode

650) this.width=650; "title=" clip_image018 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "border=" 0 "alt = "clip_image018" src= "http://s3.51cto.com/wyfs02/M01/56/A6/wKiom1SKXNjD7eOGAAHmsWSXjSk773.jpg" height= "/>"

System enters single user mode:

650) this.width=650; "title=" clip_image019 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "border=" 0 "alt = "clip_image019" src= "http://s3.51cto.com/wyfs02/M02/56/A6/wKiom1SKXNjQAeaWAAP1TlWPiJk591.jpg" height= "514"/>

The same way we can change the password by passwd root

650) this.width=650; "title=" clip_image020 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;padding-right:0px, "border=" 0 "alt=" clip_ image020 "src=" http://s3.51cto.com/wyfs02/M00/56/A3/wKioL1SKXXGy0qnmAALxvbKJGf0193.jpg "height=" 511 "/>

Log in with the modified password after reboot.

This article is from the "Gao Wenrong" blog, make sure to keep this source http://gaowenlong.blog.51cto.com/451336/1589145

Reset your root password locally under Linux (Centos, Ubuntu)

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.