This is an old revision of the document!


Reset Root Password

Reset Root Password on CentOS & RHEL

1. Reboot and Access GRUB Menu

  • Reboot the system.
  • During boot, when GRUB appears, press e to edit the default kernel entry.

2. Edit the Kernel Boot Parameters

  • Find the line beginning with linux16
  • Replace:
ro
  • with:
rw init=/sysroot/bin/sh

3. Boot with Modified Parameters

  • Press Ctrl + X to boot into single-user mode.

4. Access the System

  • Once booted, you'll be at a prompt. Run:
chroot /sysroot

5. Reset Password

  • Enter:
passwd root
  • Set the new password.
Edit this page