There are often forgotten root passwords, but CentOS 6 and CentOS 7 reset root are still different, and CentOS 7 's root password reset is relatively simple.
Root password reset for CentOS 6:
1.1: Boot can use the upper and lower keys to select the System option to reset the password, using the E key to enter the GRUB compilation option;
650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M02/82/21/wKiom1dMFzCy5fU2AAB9neKndtk061.png-wh_500x0-wm_3 -wmp_4-s_678971126.png "title=" 1.png "alt=" Wkiom1dmfzcy5fu2aab9nekndtk061.png-wh_50 "/>
1.2: Use the upper and lower keys to select the kernel key, and then press the E key to compile;
650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M02/82/20/wKioL1dMGJTjfJCnAACc9j8vRiI072.png-wh_500x0-wm_3 -wmp_4-s_1294337443.png "title=" 2.png "alt=" Wkiol1dmgjtjfjcnaacc9j8vrii072.png-wh_50 "/>
1.3: In the quiet, enter single in the space after the entry, and then press the ENTER key.
650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M02/82/21/wKiom1dMGGnBQPzcAABB71NeW9Q751.png-wh_500x0-wm_3 -wmp_4-s_3136584416.png "title=" 3.png "alt=" Wkiom1dmggnbqpzcaabb71new9q751.png-wh_50 "/>
or enter the number 1 is also OK, and then press ENTER enter key.
650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M02/82/20/wKioL1dMGeTAcoNCAABA_od_Tww175.png-wh_500x0-wm_3 -wmp_4-s_2070742964.png "title=" 4.png "alt=" Wkiol1dmgetaconcaaba_od_tww175.png-wh_50 "/>
1.4: Then press the B key in single-user mode
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/82/21/wKiom1dMGXeRtIpuAACSuaI4AyM238.png "title=" 5.png " alt= "Wkiom1dmgxertipuaacsuai4aym238.png"/>1.5: Enter passwd directly and enter the new password to be modified.
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/82/21/wKiom1dMGnPR5ncrAABIbwvkg3o352.png "title=" 6.png " alt= "Wkiom1dmgnpr5ncraabibwvkg3o352.png"/>
1.6: To this, congratulations have been modified to complete, restart can be used.
CentOS 7 Change root password:
2.1: Boot press the up and down keys to select the option to change the root password:
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/82/20/wKioL1dMKzzwBni8AAByDYflSuA768.png "title=" 1.png " alt= "Wkiol1dmkzzwbni8aabydyflsua768.png"/>2.2:centos 7 is relatively simple, in Lang=en_us. UTF-8 followed by a space input init=/bin/sh and then press the CTRL+X key, you can enter the single-user mode.
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/82/22/wKiom1dMKzuyF_4nAAC6cGU-nCU108.png "title=" 2.png " alt= "Wkiom1dmkzuyf_4naac6cgu-ncu108.png"/>2.3: Input Su-
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/82/22/wKiom1dMOomyHZZjAAAn2gBh4XQ179.png "title=" 3.png " alt= "Wkiom1dmoomyhzzjaaan2gbh4xq179.png"/>2.4: You can change the password.
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/82/21/wKioL1dMO6ORYGcsAAAomohE3Ho194.png "title=" 7.png " alt= "Wkiol1dmo6orygcsaaaomohe3ho194.png"/>
This article is from the Linux OPS blog, so be sure to keep this source http://lailai900201.blog.51cto.com/3094187/1784605
Linux forgot root password and reset root password