English
+370 5 205 5502 sales@monovm.com

Did you forget the root password of your CentOS server? Do you want to learn how to change the root password of RHEL? You are in the right place.

05

Aug, 20

How to reset linux root Password, CentOS, Fedora, RHEL

Linux has been around for multiple decades and now is being used as the go to operating system for enterprise infrastructures. Since the 90s first release, Linux has come a long way and now powers more than 70% of the internet as we know it. There are many Linux distrbutions that has come to be. 

For managing servers, administrator tend to pick Linux Distributions as it come with a huge level of flexibility and due to the fact that it's a free software. 

One such Linux disctribution is CentOS. Typical CentOS users are organisations and individuals that do not need strong commercial support in order to achieve successful operation. CentOS is 100% compatible rebuild of the Red Hat Enterprise Linux, in full compliance with Red Hat's redistribution requirements. CentOS is for people who need an enterprise class operating system stability without the cost of certification and support.

 RHEL or Red Hat Enterprise Linux is a  Linux distribution developed by Red Hat for the commercial market. All of Red Hat's official support and training, together with the Red Hat Certification Program, focuses on the Red Hat Enterprise Linux platform. Red Hat uses strict trademark rules to restrict free re-distribution of their officially supported versions of Red Hat Enterprise Linux but still freely provides its source code. Third-party derivatives can be built and redistributed by stripping away non-free components like Red Hat's trademarks. One such example is CentOS.

 Fedora is a Linux distribution developed by the community-supported Fedora Project which is sponsored primarily by Red Hat, a subsidiary of IBM, with additional support from other companies.Fedora contains software distributed under various free and open-source licenses and aims to be on the leading edge of free technologies. Fedora has 5 different editions which focus on different aspects:

  1. Workstation - focus on personal computer
  2. Server - focus on servers
  3. CoreOS - focus on cloud computing
  4. Silverblue - focus on an immutable desktop specialized to container-based workflows
  5. IoT - focus on IoT devices

While these operating systems are different, working around them is quite similar. If you have a good understanding on working with one of them, then it wont be too hard for you to work around the others. 

The main thing is that when you are working on changing settings or dealing with core components, you are only allowed to do this by using the root account. But what can you do if you forgot the Linux root password? This is a problem but not to worry. In this tutorial we will go through the easiest way to reset Linux root password. 

The methos mentioned in this guide can be used to recover CentOS root password, reset root password of Fedora and recover RHEL root password. 

Lets get to it!

how to recover Linux password

Note:

  • Before we begin, you should take a full backup of your system and files. 
  • This tutorial was made using CentOS, however the method will work for RHEL, Fedora and most Linux distributions

Step 1

  • Reboot your system and when the system is booting, press the arrow keys or space bar.

Linux Password recovery

Step 2

  • Once you hit the arrow keys, you will see something like this.
  • Select the CentOS version that you are looking to reset root password in by using the up and down arrow keys

Step 3 

  • Now press a on your keyboard. You will see a window as shown below.

Step 4

  • Now press space and type in 1. 
  • Press enter

Step 5 

  • After that your system will boot as single user mode

Step 6

  • In order to check what we have done so far was accurate type runlevel
  • If the result is 1 s we can proceed further.

Step 7

Now its time to change the password by typing  passwd

Enter the new password. Note that you will not see the password that you are typing. This is a security measure of Linux distros. 

Congratualtions are in order. You successfully reset the root password of CentOS. Let us know in the comments below if it worked and don't forget to share it with your friends. Dont have a CentOS device? You can get your very own CentOS powered Private Server from Monovm. 

susith nonis

I'm fascinated by the IT world and how the 1's and 0's work. While I veture into the world of Technology I try to share what I know in the simplest way to you. Hope you like it.