March 26, 2018

How to change root password in CentOS 7



1. In the kernel selection screen when system booting, press the arrow keys(↑,↓) to select kernel and press "e" key to go GRUB.

2. Input " rd.break" at the end of the line containing "linux16" and press "ctrl + x".

3. # mount -o rw,remount /sysroot

4. # chroot /sysroot

5. # passwd

6. # touch /.autorelabel

7. Press ctrl+d

8. Press ctrl+d