How to reset the root password of CentOS 7? Methods and steps of setting root password of CentOS 7

Time:2021-6-12

The way to reset the password of CentOS 7 root is completely different from that of CentOS 6. Let me show you how it works.

1 – in the start grub menu, select the edit option to start

2 – press key e to enter the editing interface

3 – find the line of Linux 16 and change RO to RW init = / sysRoot / bin / sh

4 – now press control + X to start in single user mode

5 – now you can access the system using the following command

chroot /sysroot

6 – reset password

passwd root

7 – update system information

touch /.autorelabel

8 – exit chroot

exit

9 – restart your system

reboot

Through the above steps, you can reset the root password of CentOS 7. Thank you for reading. I hope it can help you. Please continue to pay attention to developer. We will try our best to share more excellent articles.