Home > HowTo, Linux, Security > Centos 7 change root passwd

Centos 7 change root passwd

February 7th, 2017 Leave a comment Go to comments

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
Categories: HowTo, Linux, Security Tags:
  1. No comments yet.
  1. No trackbacks yet.