How To Reset Forgotten Root Password on RedHat 6 / CentOS 6

RedHat 6 / CentOS 6 system gives us the opportunity to reset root password in case we forget it, on condition that we have a direct access to the machine on which we want to reset root password. Password can be reset after booting the system into single-user mode.

Steps:

1. Reboot the system

2. At the screen: “Booting Red Hat Enterprise Linux…” or “Booting CentOS…” press any key to display GRUB menu.

3. At the GRUB menu select kernel version and press a to append to the list of kernel parameters:

grub_menu

4. Add s at the end of the kernel parameters list (to boot to the single-user mode) and press Enter:

kernel_parameters_edit

5. Reset root password at the single-user mode prompt:

[root@tuxfixer /]# passwd
Changing password for user root.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.

6. Switch to graphic mode (runlevel 5) or reboot:

[root@tuxfixer /]# init 5

or

[root@tuxfixer /]# reboot
Liked it? Take a second to support tuxfixer.com on Patreon!

Share on: Share on FacebookShare on Google+Tweet about this on TwitterShare on StumbleUponShare on LinkedInPin on PinterestBuffer this pageShare on TumblrDigg thisFlattr the authorShare on RedditShare on VKShare on Yummly

Leave a Reply

Name *
Email *
Website