Reset the password from single user mode in CentOS7

While booting up your machine, select the existing kernel and press ‘e’

1

Replace the entry ‘ro‘ with ‘rw init=/sysroot/bin/sh’

2

changed to

3

Press ctrl+x to save and start single user mode using the bash shell we mentioned above.

Run the below command and change password after that:

chroot /sysroot

passwd

6

Update selinux parameters as below :

touch /.autorelabel

7

Now reboot your machine. It may take some time to apply the apply the changes while booting up.

8

Thanks 🙂

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s