Resetting the root password and enhancing logging

With the release of CentOS 7, you may find that the process of resetting the root password has changed. So, in the event that you forget the root password, you will need to follow these important steps.

Boot the computer and press the E key during the kernel screen phase. On the next screen, scroll down the text and look for the following line:

root=/dev/mapper/centos-root ro

Now, replace the letters ro with the following:

rw init=/sysroot/bin/sh

It should then look like this:

root=/dev/mapper/centos-root rw init=/sysroot/bin/sh

When done, press Control + X or Ctrl + X to boot into the single user mode using the bash shell /sysroot/bin/sh.

In the single user mode, type:

# chroot /sysroot

After the hash ...

Get Troubleshooting CentOS now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.