How to Change Forgotten Root Password in RHEL 9

How to Change Forgotten Root Password in RHEL 9

Although, it is recommended to have a complex password for the Linux system so that it cannot be stolen with brute force or a dictionary attack. Chances are the complex password can be forgotten by the user.

The aim of this guide is to teach you the method to change your root password if you have forgotten it in Red Hat Enterprise Linux 9.

We assume you have a user who is added to the Wheel group (which is a default group with sudo privileges).

Prerequisite

  • Root account or an account with sudo privileges
  • RHEL 9 instance

Changing Forgotten Root Password in Red Hat Enterprise Linux 9

Type the following command on the terminal.

sudo passwd root

Provide your password and then press <Enter> key from the keyboard. 

Submit the new root password twice and press <Enter> key from the keyboard.

Conclusion

I hope you have recovered your root password. If not we can help you out. You can get in touch with us using a comment form.

Good Luck!!