Reset root password single user mode :: Centos 7

Here we are seeing how to reset the root password of a Centos 7 server using single user mode. The method is mainly applicable for dedicated servers since there are options available in the control panel to reset the password for a VPS using any virtualization platform. 

  1. Login to the IPMI and start the Java Console.
  2. Reboot the server and in the grub menu, you need to select the option to edit by pressing 'e'.
  3. There you can see some texts and you can find the following words in the 16th line:
    ro rd.lvm. lv=centos
  4. Please remove 'ro' and add the following instead:
    rw init=/sysroot/bin/sh 
    so it will look like 
    rw init=/sysroot/bin/sh rd.lvm. lv=centos
  5. Then press ctrl+x to start the single user mode.
  6. There you will get a command prompt. Please type the following command there:
    #chroot /sysroot
  7. Then reset the root password using passwd command:
    #passwd root
  8. Update SELinux information by using the following command:
    #touch /.autorelabel
  9. Then exit and reboot the system using the following:

  10. Once rebooted, you can log in to the server using the newly set password.

Here is the video tutorial for the same:

  • root passwod reset, single user mode
  • 1 Корисниците го најдоа ова како корисно
Дали Ви помогна овој одговор?

Понудени резултати

How To Install and Use Docker on Ubuntu 16.04

Introduction Docker is an application that makes it simple and easy to run application processes...

Change Main IP of the server :: Vesta Panel

If we are changing the main IP of a server installed with Vesta panel, we can use the following...

cPanel: Apache-FastCGI Data Timeout Error

If you are using a cPanel server and have FastCGI enabled in Apache, you might be facing the...

Domainkey installer in cPanel

You can use the following cPanel script to install domainkey for an account...

Email issues :: Common Troubleshooting Steps

Here I will discuss some common errors and their solution: We are using a mail relay setup for...