Linux system root user forgot password solution

Source: Internet
Author: User

Linux system root user forgot password solution

First, centos6 root user forgot password solution

1 , Grub unencrypted (known grub password) root password recovery method:

(1) Restart the system, press any key at the system wait time to enter a display interface

650) this.width=650; "title=" 1.jpg "src=" https://s2.51cto.com/wyfs02/M01/8F/91/wKiom1jlBZ_ Znk0taackafbmwfm515.jpg-wh_500x0-wm_3-wmp_4-s_3439017864.jpg "alt=" wkiom1jlbz_znk0taackafbmwfm515.jpg-wh_50 "/ >

Figure A

(2) Press "E" key in the interface shown in figure one to enter the two interface

650) this.width=650; "title=" 2.png "src=" https://s2.51cto.com/wyfs02/M01/8F/8E/ Wkiol1jlbbrxnhtmaaa4f2g95fi174.png-wh_500x0-wm_3-wmp_4-s_2164252608.png "alt=" Wkiol1jlbbrxnhtmaaa4f2g95fi174.png-wh_50 "/>

Figure II

(3) Select the second item in the interface shown in Figure two, and press "E" to enter the interface shown in Figure three.

650) this.width=650; "title=" 3.jpg "src=" https://s5.51cto.com/wyfs02/M02/8F/91/ Wkiom1jlbc6dtclraab8zgjypfe722.jpg-wh_500x0-wm_3-wmp_4-s_819237740.jpg "alt=" Wkiom1jlbc6dtclraab8zgjypfe722.jpg-wh_50 "/>

Might

(4) In the interface shown in figure three quite after adding the parameters of single or number 1, press ENTER to return to the interface shown in Figure two, select the second item, press "B" into the system, at this time, enter the system does not need a password, enter the system input passwd directly for the root user set password, four shows, After setting the password restart.

650) this.width=650; "title=" 4.jpg "src=" https://s5.51cto.com/wyfs02/M02/8F/8E/ Wkiol1jlbekzfb0yaabtr9pdlrm434.jpg-wh_500x0-wm_3-wmp_4-s_388405566.jpg "alt=" Wkiol1jlbekzfb0yaabtr9pdlrm434.jpg-wh_50 "/>

Figure Four

Second, centos7 root user forgot password solution

1 , in the Boot Grub menu interface, press "E" to enter the editing interface, shown in five

650) this.width=650; "title=" 5.jpg "src=" https://s4.51cto.com/wyfs02/M00/8F/91/ Wkiom1jlbferijrsaabrzklkxhk000.jpg-wh_500x0-wm_3-wmp_4-s_2870857168.jpg "alt=" Wkiom1jlbferijrsaabrzklkxhk000.jpg-wh_50 "/>

Figure Five

2 Press "↓" to find the penultimate row ro (six), change the RO to RW init=/sysroot/bin/sh, and then press CTRL+X to start the system to enter single user mode

650) this.width=650; "title=" 6.jpg "src=" https://s3.51cto.com/wyfs02/M00/8F/8E/ Wkiol1jlbgqziki6aadcmx12yrc176.jpg-wh_500x0-wm_3-wmp_4-s_23604774.jpg "alt=" Wkiol1jlbgqziki6aadcmx12yrc176.jpg-wh_50 "/>

Figure Six

650) this.width=650; "title=" 7.jpg "src=" https://s2.51cto.com/wyfs02/M01/8F/91/ Wkiom1jlbjkqemzmaaewyyxyuhy282.jpg-wh_500x0-wm_3-wmp_4-s_820311205.jpg "alt=" Wkiom1jlbjkqemzmaaewyyxyuhy282.jpg-wh_50 "/>

Figure Seven

3 , enter Chroot/sysroot as shown in single-user mode eight, and then use the passwd root command to make the password more

650) this.width=650; "title=" 8.jpg "src=" https://s2.51cto.com/wyfs02/M01/8F/8F/ Wkiol1jlbmksoxvmaacyktizvfc562.jpg-wh_500x0-wm_3-wmp_4-s_1221399223.jpg "alt=" Wkiol1jlbmksoxvmaacyktizvfc562.jpg-wh_50 "/>

Figure Eight

4 , if you have previously enabled SELinux, you must run touch/.autorelabel, as shown in nine otherwise, the system is not functioning properly, and rebooting the system after the operation is complete.

650) this.width=650; "title=" 9.jpg "src=" https://s3.51cto.com/wyfs02/M02/8F/8F/ Wkiol1jlbnvrnr1raabpysy40ba429.jpg-wh_500x0-wm_3-wmp_4-s_1020653882.jpg "alt=" Wkiol1jlbnvrnr1raabpysy40ba429.jpg-wh_50 "/>

Figure Nine

This article is from the "dayi123" blog, make sure to keep this source http://dayi123.blog.51cto.com/12064061/1913238

Linux system root user forgot password solution

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.