How to Reset forgotten root password in RHEL/CentOS 7/8

As a Linux Administrator, You must know the importance of root User.

Without root User, you cannot do any kind of configuration in Linux such as creating a partition, Configuring a service, and so on.

That’s why root is also called as Superuser.

Just think about what will happen if you forget the root user’s password.

In this guide, I will teach you How to reset forgotten root password in RHEL/CentOS 7/8

I will teach you two methods by which you can reset the root password.

Let’s get started.

**Method #1
**

First, let’s focus on the method one.

Step #1 Reboot your RHEL/CentOS 7/8 Server
reset the forgotten root password, we have to boot the server in the single-user mode for which we have to edit the Grub menu.

Hence to do this restart the server.

As soon as you restart the server, you will get the following screen.

Here you will get 5 seconds to interrupt the normal boot process. So quickly press any key to interrupt the boot process.

Step #2 Edit the Grub Menu

Now select the highlighted menu and press e to edit the same.

Note: You can select the menu by using up and down arrow on your Keyword.

**Step #3 Make necessary changes
**

Now look for the line that contains Linux kernel executable that is vmlinuz. Highlighted in the below snapshot.

Move the cursor to the end of that line then next to quiet give a space and type rd.break. Refer to the snapshot below.

Note: You can use up, down, right, and left arrow on your Keyword to move the cursor. To go to the end of the line press CTRL+E.

After typing as instructed on the screen, press CTRL+X to proceed to the next step.

After following the above steps, we have successfully come into single-user mode and we’ve got bash prompt to type the commands.

Complete Story


关于作者: 网站小编

码农网专注IT技术教程资源分享平台,学习资源下载网站,58码农网包含计算机技术、网站程序源码下载、编程技术论坛、互联网资源下载等产品服务,提供原创、优质、完整内容的专业码农交流分享平台。

热门文章