How To Reset Root Password In Linux with Screenshot

This article explains the process of resetting the root password in a CentOS Linux machine in case you have forgotten the root password. “Root” is the superuser of a Linux machine. In order to access the Linux server as a root user, you need to authenticate first. In case you have forgotten root password, you can reset it by logging in to the machine in “single user mode”. Single user mode (run level 1) is an important runlevel in which only the system administrator is using the machine and has only as few system services as possible are running, including logins.

We can go through the following steps for entering the single user mode:

Step 1

Boot your Linux machine and select the OS when it enters the GRUB. Here, only “CentOS” is available in this Linux machine. Type “e” to edit the entry.


CentOS Grub

Step 2

It will display a page similar to the one shown below. Select the second line which specifies “kernel”. Then, type “e” to edit this line.


CentOS Grub

Step 3

It will start the grub editor where you can edit the entry. At the end of the line, append the word “single” or character 'S'. Then press “ENTER”.


Grub CentOS

Then, type “b” to boot the machine. The Linux machine will boot into single user mode and will display a shell prompt. Now, you can reset the root password using the following command:


It will prompt to enter the password. Once you have successfully changed the password, reboot the machine using the “reboot” command.

CentOS Single User Mode

Single User Mode

Bobbin Zachariah 10:50 am

About Bobbin Zachariah

Founder of LinOxide, passionate lover of Linux and technology writer. Started his career in Linux / Opensource from 2000. Love traveling, blogging and listening music. Reach Bobbin Zachariah about me page and google plus page.

Author Archive Page

Have anything to say?

Your email address will not be published. Required fields are marked *

All comments are subject to moderation.