Tools Links Login

Change the root password on CentOS 7

I stumbled across this today, and it worked. I haven't tested it on v8, though. Maybe give it a shot on v8 and let me know in the comments?

At the boot menu, press e to edit the existing kernel (Core).

Scroll down to the list until you see the line ro,change ro to rw and start into a bash shell. It should look like rw init=/sysroot/bin/sh.

Press Ctrl + X to start into single user mode.

In the single user mode run the commands:

chroot /sysroot
passwd root
touch /.autorelabel

Exit and reboot your system. You should be able to sign on and use the system with the new password.

About this post

Posted: 2020-07-14
By: dwirch
Viewed: 259 times

Categories

Attachments

No attachments for this post


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.