How to reset root password on CentOS 7

First, reboot or power on your CentOS 7 system. Next, press ‘e’ on the keyboard to interrupt the boot process to make changes.

After pressing “e“, scroll down to linux16 line and add rd.break parameter at the end of line. The Linux16 line will be linuxefi on the UEFI system.

Now, press Ctrl+x to boot with changed parameters. rd.break breaks the boot process at initramfs.

Once the system boots up the switch_root prompt will appear.
Remount the read-only file system to read & write permission by below command :

mount -o remount,rw /sysroot

Change shell to file-system’s root by below command :

chroot /sysroot

This will change the shell to sh-4.x.
Now, change the root password.

Now run exit command twice to Reboot the server .

Thank you for reading this article.

Was this helpful?

3 / 0

Leave a Reply 8

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


gVsEeLiArbChDkSm

gVsEeLiArbChDkSm

It was very helpful for me!

JeHYZnTclywi

JeHYZnTclywi

Thank you!

zovroptor

zovroptor

Simply wanna input that you have a very nice site, I like the style and design it really stands out.

zortilonrel

zortilonrel

Great post. I am facing a couple of these problems.

zoritoler imol

zoritoler imol

I like this web site very much so much fantastic info .

jokerin

jokerin

Very nice post. I absolutely love this site. Continue the good work!

sbobet8

sbobet8

Undeniably believe that which you stated. Your favorite justification appeared
to be on the web the easiest thing to be aware of. I say to
you, I certainly get irked while people consider worries that they just
don’t know about. You managed to hit the nail upon the top as well as defined out the whole
thing without having side effect , people could take a signal.
Will probably be back to get more. Thanks

zorivareworilon

zorivareworilon

Respect to article author, some great entropy.