When you forget the system administrator password for Linux, you can reset the root password locally by entering single-user mode. The two methods (just two steps) are as follows:
Method One:
When you enter the Grub boot menu
650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M01/82/A0/wKiom1ddEmOgYciUAABdUL5M1VY459.jpg-wh_500x0-wm_3 -wmp_4-s_2218124263.jpg "title=" 11.jpg "alt=" Wkiom1ddemogyciuaabdul5m1vy459.jpg-wh_50 "/>
press the "a" key operation to edit the kernel parameter followed by "single" to tell the Linux kernel to run in one-user mode, enter to start. After entering, enter the passwd in the command line, enter a new password, repeat input, done. After restarting, enter a new password to log in. (note: The Grub interface time is very short, about 5 seconds, seize the opportunity, if you do not want to wait, in the Linux startup when the random press a key such as "a" will jump to the Grub interface)
Steps:
650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M01/82/A0/wKiom1ddFQLRQQ9hAABZp-JUh5c050.jpg-wh_500x0-wm_3 -wmp_4-s_2471524008.jpg "title=" 12.jpg "alt=" Wkiom1ddfqlrqq9haabzp-juh5c050.jpg-wh_50 "/>
650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M02/82/9E/wKioL1ddFoCwU28QAAEDJljvtnU630.jpg-wh_500x0-wm_3 -wmp_4-s_430225069.jpg "title=" 13.jpg "alt=" Wkiol1ddfocwu28qaaedjljvtnu630.jpg-wh_50 "/>
650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M00/82/9E/wKioL1ddFqDgTvuYAAEFtwXJ4Wk995.jpg-wh_500x0-wm_3 -wmp_4-s_4107403724.jpg "style=" Float:none; "title=" 14.jpg "alt=" Wkiol1ddfqdgtvuyaaeftwxj4wk995.jpg-wh_50 "/>
650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M01/82/9E/wKioL1ddFqDjOMCDAADeLIJOZAk767.jpg-wh_500x0-wm_3 -wmp_4-s_3758303242.jpg "style=" Float:none; "title=" 15.jpg "alt=" Wkiol1ddfqdjomcdaadelijozak767.jpg-wh_50 "/>
Method Two:
in the GRUB boot menu, use the "E" action button to enter the CentOS boot menu to the interface, move the cursor to the "kernel" configuration item line, position the cursor to the Kernel menu item, and press "E" key to edit the "kernel" menu item, enter single at the end of the row To tell the Linux kernel that subsequent boot processes need to go into single-user mode and then enter back to the Boot menu selection interface. then we follow the on-screen prompts, press "B" to start the system with the menu option just edited, and then go in single-user mode. Enter the single-user name mode, the system does not require password authentication, and the direct access to the root authority, the next is the same as Method 1, enter the passwd command to change the password.
The steps are as follows:
650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M01/82/A0/wKiom1ddF0HCMjTuAABqjTYVMxc234.jpg-wh_500x0-wm_3 -wmp_4-s_2816726922.jpg "style=" Float:none; "title=" 21.jpg "alt=" Wkiom1ddf0hcmjtuaabqjtyvmxc234.jpg-wh_50 "/>
650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M01/82/9E/wKioL1ddGFCzWgO9AABAh0tFHxQ952.jpg-wh_500x0-wm_3 -wmp_4-s_1911413132.jpg "style=" Float:none; "title=" 22.jpg "alt=" Wkiol1ddgfczwgo9aabah0tfhxq952.jpg-wh_50 "/>
650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M02/82/A0/wKiom1ddF0KBMM8zAADmT3O6fIw565.jpg-wh_500x0-wm_3 -wmp_4-s_2703042201.jpg "style=" Float:none; "title=" 23.jpg "alt=" Wkiom1ddf0kbmm8zaadmt3o6fiw565.jpg-wh_50 "/>
650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M02/82/9E/wKioL1ddGFGQTC3FAAEdKUfOadA711.jpg-wh_500x0-wm_3 -wmp_4-s_104503288.jpg "style=" Float:none; "title=" 24.jpg "alt=" Wkiol1ddgfgqtc3faaedkufoada711.jpg-wh_50 "/>
This article from "Li Xiaodong" blog, reproduced please contact the author!
What if I forget the root password in Linux? Two ways to make it easy for you to fix the new password (centos6.x only)