TechSpite
TechSpite
Contact
  • Home
  • About Us
  • How To
  • Windows
  • MAC OS
  • iOS

About TechSpite

  • About Us
  • Contact

Explore Topics

  • Conversational AI – Game Changer Talking Tech
  • Top Business Intelligence Tools For Data Analysis
  • How RPA Enhances Customer Service
  • Understanding Autonomous Vehicle Technology

Help & Support

  • Contact

Terms & Privacy

  • Privacy Policy
  • Terms & Conditions
  • Return and Refund Policy
TechSpite

© 2026 TechSpite. All rights reserved.

TOP
  1. Home
  2. /
  3. How To
  4. /
  5. How to Reset CentOS Root Password?
How To

How to Reset CentOS Root Password?

Azaz ShaikhAzaz Shaikh
•Jan 18, 2022•2 MIN READ
How to Reset CentOS Root Password?
How to Reset CentOS Root Password?

In order to keep any device private or safe from strangers then we need to password protect the device. A strong password will be better and difficult to be predicted by someone. I usually add a strong password to my laptop so that no one should think to get access. But remembering a strong password is really difficult because one day we might forget that. At that time, we have to reset the password which will be pretty time-consuming. Whenever I password protects my gadget or social media accounts, I try to note them down on a notebook so that I should not forget that. Therefore, in this article, I will show you how to reset CentOS root password.

Most of the time, it happens that we may forget the password. If you forget the password of your CentOS, then don’t worry because there is a simple solution. It happens when you don’t log in as a root user for a long time. I have also installed CentOS on a virtual machine but now I forgot the root password, I researched and found out an easy procedure to reset CentOS’s lost password. I have tried many times and it worked very well, you can also try the below procedure to Reset CentOS Root Password.

How to Reset CentOS Root Password

Step 1. At first, make sure to reboot your CentOS system, on the boot page, you need to select CentOS Linux 7 or 8 and press E to edit the selected option.

CentOS 7 or 8

Step 2. Now, scroll down until you find the underlined below ro. You have to delete the selected yellow code and replace it with the next screenshot code.

Bring Changes

Step 3. Here you have to change the ro into rw to start into a bash shell. It should look like rw init=/sysroot/bin/sh.

Reset CentOS Root PasswordChange the command

Step 4. When you did that, just press ctrl + X from your keyboard in order to start single-user mode using the bash shell.

Reset CentOS Root PasswordReset CentOS Root Password Now

Step 5. At last, type chroot /sysroot command and press enter. Then type password root in order to change the root password. Type your new password two times and you are done with your password of CentOS.

Step 6. Finally, after changing the root password, type touch /.autorelabel to update SELinux parameter. When you have done everything, exit and reboot the system.

Bottom Line

It was step by step guide on How to Reset CentOS Root Password. Whenever you forget the password of the CentOS system, you can follow up the above method. Therefore, I hope you found this article helpful. If you faced any kind of problem while resetting CentOS forgotten password, then you comment down below.

Explore more:

  • How to Reset Kali Linux Root Password
  • How to Set Static IP Address in Kali Linux using GUI and ifconfig

Tagged

#CentOS#CentOS Linux#CentOS Linux 8#CentOS Root Password#Reset CentOS Forgotten Password#Reset CentOS Root Password#Reset Forgotten Root Password in CentOS 8

Share This Article

Recent Articles

Fresh content from our blog

Instagram Marketing: 10 Trends To Follow In 2023
Featured

Instagram Marketing: 10 Trends To Follow In 2023

May 23, 2023
11 Must-Know TikTok Tips for Going Viral!
Featured

11 Must-Know TikTok Tips for Going Viral!

May 17, 2023
17 Epic Facebook Tips And Tricks You Never Knew Existed!
Featured

17 Epic Facebook Tips And Tricks You Never Knew Existed!

May 14, 2023
12 Beginner-Friendly iPhone Photography Tips for Instagram
Featured

12 Beginner-Friendly iPhone Photography Tips for Instagram

May 3, 2023
12 Windows 11 Tips and Tricks To Make Your PC Awesome!
Featured

12 Windows 11 Tips and Tricks To Make Your PC Awesome!

May 1, 2023

In order to keep any device private or safe from strangers then we need to password protect the device. A strong password will be better and difficult to be predicted by someone. I usually add a strong password to my laptop so that no one should think to get access. But remembering a strong password is really difficult because one day we might forget that. At that time, we have to reset the password which will be pretty time-consuming. Whenever I password protects my gadget or social media accounts, I try to note them down on a notebook so that I should not forget that. Therefore, in this article, I will show you how to reset CentOS root password.

Most of the time, it happens that we may forget the password. If you forget the password of your CentOS, then don’t worry because there is a simple solution. It happens when you don’t log in as a root user for a long time. I have also installed CentOS on a virtual machine but now I forgot the root password, I researched and found out an easy procedure to reset CentOS’s lost password. I have tried many times and it worked very well, you can also try the below procedure to Reset CentOS Root Password.

How to Reset CentOS Root Password

Step 1. At first, make sure to reboot your CentOS system, on the boot page, you need to select CentOS Linux 7 or 8 and press E to edit the selected option.

CentOS 7 or 8

Step 2. Now, scroll down until you find the underlined below ro. You have to delete the selected yellow code and replace it with the next screenshot code.

Bring Changes

Step 3. Here you have to change the ro into rw to start into a bash shell. It should look like rw init=/sysroot/bin/sh.

Reset CentOS Root PasswordChange the command

Step 4. When you did that, just press ctrl + X from your keyboard in order to start single-user mode using the bash shell.

Reset CentOS Root PasswordReset CentOS Root Password Now

Step 5. At last, type chroot /sysroot command and press enter. Then type password root in order to change the root password. Type your new password two times and you are done with your password of CentOS.

Step 6. Finally, after changing the root password, type touch /.autorelabel to update SELinux parameter. When you have done everything, exit and reboot the system.

Bottom Line

It was step by step guide on How to Reset CentOS Root Password. Whenever you forget the password of the CentOS system, you can follow up the above method. Therefore, I hope you found this article helpful. If you faced any kind of problem while resetting CentOS forgotten password, then you comment down below.

Explore more:

  • How to Reset Kali Linux Root Password
  • How to Set Static IP Address in Kali Linux using GUI and ifconfig

Tagged

#CentOS#CentOS Linux#CentOS Linux 8#CentOS Root Password#Reset CentOS Forgotten Password#Reset CentOS Root Password#Reset Forgotten Root Password in CentOS 8

Share This Article

Recent Articles

Fresh content from our blog

Instagram Marketing: 10 Trends To Follow In 2023
Featured

Instagram Marketing: 10 Trends To Follow In 2023

May 23, 2023
11 Must-Know TikTok Tips for Going Viral!
Featured

11 Must-Know TikTok Tips for Going Viral!

May 17, 2023
17 Epic Facebook Tips And Tricks You Never Knew Existed!
Featured

17 Epic Facebook Tips And Tricks You Never Knew Existed!

May 14, 2023
12 Beginner-Friendly iPhone Photography Tips for Instagram
Featured

12 Beginner-Friendly iPhone Photography Tips for Instagram

May 3, 2023
12 Windows 11 Tips and Tricks To Make Your PC Awesome!
Featured

12 Windows 11 Tips and Tricks To Make Your PC Awesome!

May 1, 2023

About the Author

Azaz Shaikh

About Azaz Shaikh

Azaz Shaikh is a contributor to this blog, sharing expertise and insights on tech solutions.

You Might Also Like

How to change message background on Android
Android

How to change message background on Android

In the digital age, personalization is key. From customizing your ringtones to wallpapers that grace your screens, we love making our devices uniquely ours. One such personal touch that often gets overlooked is the background of text messages on Android. Gone are the days when users were confined to the standard, monotonous backgrounds that came

Sep 28, 2023
The Ultimate Guide to Casting Oculus Quest 2 to Firestick: Unlock a Whole New Dimension of VR
Entertainment

The Ultimate Guide to Casting Oculus Quest 2 to Firestick: Unlock a Whole New Dimension of VR

Virtual reality has become incredibly popular captivating users with its thrilling and immersive experiences that are truly unprecedented. There are two known devices that allow people to enter this world; the Oculus Quest 2 and the Amazon Firestick. In this guide, we will delve into the steps involved in casting your Oculus Quest 2 to

Sep 21, 2023
10 Best LinkedIn Tips To Boost Career Opportunities
Featured

10 Best LinkedIn Tips To Boost Career Opportunities

With over 700 million professionals on its platform, LinkedIn has become a powerhouse for networking, job hunting, and professional growth. This ultimate guide will help you explore the top 10 LinkedIn tips that can significantly boost your career opportunities in every possible way.  Did you know that LinkedIn has witnessed a staggering 55 million companies

May 19, 2023

Comments

Leave a Comment

Share your thoughts and join the conversation

Your email address will not be published. All fields marked with * are required.