How to reset forgotten root password in centos 7/8

How to reset forgotten root password in centos 7/8

First, reboot or power on your CentOS 8 system. Select the kernel that you want to boot into. Next, press ā€˜eā€™ to interrupt the boot process and make changes.

Replace the kernel parameter ro with rw and append an extra kernel parameter init=/sysroot/bin/sh.

Press Ctrl+x combination on the keyboard to enter single-user mode.

Next, run the command below to mount the root file system in read and write mode.

chroot /sysroot

You can now change the root password by executing the command:

passwd

To apply the changes, exit and reboot the CentOS 8 system.

Thankyou.


    • Related Articles

    • How to reset forgotten root password in Debian

      In this tutorial, we will learn how to reset a forgotten root password in a Debian system.  So, first power on or reboot Debian system. It should be presented with a GRUB menu as shown below. On the first option, proceed and press the ‘e’ key on the ...
    • How to reset forgotten root password in ubuntu 16/18

      Firstly, you need to power on or reboot your Ubuntu system. You should get a grub menu as shown below. Next, press the 'e' key to edit the grub parameters. This should display a screen as shown below. Scroll down until you get to the line that begins ...
    • How to Mount LiveCD ISO in Centos 7

      Why we required to Mount LiveCD ISO In some cases we need to mount liveCD. Suppose you are working on live server and by mistake you deleted some of OS file or due to any reason unable to boot server. In this case you can mount liveCD of that OS and ...
    • Install CWP in Centos 7

      CWP is an free and paid license based hosting panel for managing website database,emails,file,etc using a single Panel. In this article we will discuss how to install CWP in Centos 7 Software Requirements You must have a clean/fresh installation of ...
    • INSTALLATION AND CONFIGURATION OF APACHE TOMCAT 9 ON CENTOS 7

      Apache Tomcat program is an open-source application of Java Servlet, JavaServer Pages, Java Expression Language and Java WebSocket technologies. Under the Java Community Process the Java Servlet, JavaServer Pages, Java Expression Language and Java ...