Centos 7 change root passwd

How to change root password on Centos 7

  1. reboot press ESC to go into menu, then press ‘e’ to edit
  2. change line of Linux 16 and change ro with rw init=/sysroot/bin/sh
  3. CRTL-X to boot
  4. chroot /sysroot
  5. passwd root
  6. touch /.autorelabel
  7. reboot -f

Troubleshooting try after step 3:

    mount -o remount,rw /
    cp /etc/shadow- /etc/shadow

Leave a Reply

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