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:
- Workstation - focus on personal computer
- Server - focus on servers
- CoreOS - focus on cloud computing
- Silverblue - focus on an immutable desktop specialized to container-based workflows
- 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
- 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
- Reboot your system and when the system is booting, press the arrow keys or space bar.
- 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
- Now press a on your keyboard. You will see a window as shown below.
- Now press space and type in 1.
- Press enter
- After that your system will boot as single user mode
- In order to check what we have done so far was accurate type
- If the result is
1 swe can proceed further.
Now its time to change the password by typing
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.