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


<<:  uname Command in Linux with Examples

>>:  【左京淳的JAVA学习笔记】第七章 API

Day06 - 监控 Sidekiq 有无正常运作(或执行超过多久)

前言 去年介绍过 Day25 - Ruby on Rails 中的 Sidekiq 的介绍与应用 ,...

Day7-在认识 useMemo 前,先认识 React.memo

今天介绍的是避免重新渲染的 HOC(Higher Order Component) React.me...

第3砍 - 不亮也光

烦恼着要开始上班了 菜鸟人生 Start?[Y/N] > N 今天还没进入正题 因为我们需要先...

Mikrotik RouterOS从入门到实战系列-Mikrotik入门第四课

Mikrotik RouterOS从入门到实战系列-Mikrotik入门第四课 VPN详解与实战应用...

误格式化硬碟/记忆卡/随身碟?

给大家分享一个超实用的硬碟/行动硬碟/记忆卡/随身碟误格式化资料、照片、影片的救援方法。 我们知道,...