Table of Contents

Reset Root Password

On CentOS & RHEL

1. Reboot and Access GRUB Menu

2. Edit the Kernel Boot Parameters

ro
rw init=/sysroot/bin/sh

3. Boot with Modified Parameters

4. Access the System

chroot /sysroot

5. Reset Password

passwd root

6. Relabel SELinux Contexts (if enabled)

touch /.autorelabel

7. Exit and Reboot

exit
reboot

On Ubuntu

1. Reboot and Access GRUB Menu

2. Edit the Boot Parameters

linux
ro quiet splash
rw init=/bin/bash

3. Boot into Shell

4. Reset Password

passwd root

5. Remount and Reboot Cleanly

mount -o remount,rw /
exec /sbin/init
reboot -f