Thursday, August 21, 2014

Reset Root Password on CentOS 5 & 6


1.

Boot or Reboot your CentOS installation

From the console ATL+CTRL+DEL will get you headed in the right direction.
F57490026cf21a99672045b53f182186ebe80e6cc0620e629e770c2641c977e3_ctrl_alt_del_big
2.

Press Any Key

After the installation reboots, it will come up to a boot countdown. Here, you can press any key, I don't have one either, but any other key works also.
This will bring you to the GRUB menu.
3452f8db7203304f8748f2079e098420af95d7e2d8cc3cbb8ca67236c8b31082_pressanykey_big
3.

GRUB Menu

From the GRUB menu, select the appropriate kernel version and press the 'e' key.
You will now be presented with the option menu for the kernel version.
39242d989527920187c0e7c6a631c66a57241b7c73e0e6622c5d462d63e47cc9_grubmenu_big
4.

Kernel Options Menu

From this menu, select the kernel /vmlinuz-... line and press the 'e' key.
You will now be presented with the kernel boot options.
B06e65d5bfe0431b221da2d5a6b7627a8588bd2bbcaf1e79dfd7182d344e1773_kerneloptionsmenu_big
5.

Change Kernel Boot Options

Now we need to add to the end of this line one o the following:
1, s, or single
And now press Enter to save your changes.
C24410ec089f7ad524023f91ceb66454e932d562ca3d68602b63affecf253f8f_kernelbootoptionsmenu_big
6.

Boot your temporary options

From this menu, you should already be on the kernel /vmlinuz... line.
Press the 'b' key to boot to these temporary options to allow you to recover your root account.
2976ddc77f756bc795e082b3d553afccb63a95d5f419147d72575a7f9b4c4b85_kerneloptionsmenu_big
7.

Set Root Password

Now you will boot up to the root shell and you can use passwd to set your new password.
You will be required to enter the password twice.
Once you have completed this, reboot and you have a new root password for your CentOS installation.
1d2eb3ca440800d668e5123c8e2ece81de11aa565aa6aeb1f17d11afb3be8703_passwd_big

No comments: