Sunday 16 August 2020

How to Reset Forgotten root Password on CentOS 8


How to Reset Forgotten root Password on CentOS 8

In Linux, root privileges refers to a user account that has full access (called root user/access) to all files, directories, applications, system applications and system functions.

This article describes How to Reset Forgotten root Password on CentOS 8. Here Virtual Box console used for demonstration.

Step 1 Interrupt Boot process: While powering on or rebooting a running system, when the GRUB boot menu appears, select the kernel version and press e to edit the selected boot entry:














Next screen will shew the selected kernel parameters i.e. hard disk, root partition, location of the kernel, crash kernel, and initrd (Initial ram disk):

Step 2. Edit Kernel Parameters: Append an extra kernel parameter rd.break at the end of the line as shown in the below screenshot and press ctrl+x to continue the boot process:














Step 3. Check the File System: Once the server is comes up check the file system and remount /sysroot directory with read and write access, by default it is mounted in Read Only mode:












Step 4. Set Root Password: Run the following commands to enter into chroot and set root password. Once done force the file system relabeling, its take time according to the disk utilization:
















Step 5. Exit and logout: All set done, exit from the chroot and logout to reboot and relabeling the file system:

















Done! Password set successfully. Once system comes up try to login using root user and password…

No comments:

Post a Comment