Skip to content

Instantly share code, notes, and snippets.

@spryffee
Last active December 18, 2020 21:07
Show Gist options
  • Save spryffee/249ecfc10e08d6dcd3dc889a18f127bd to your computer and use it in GitHub Desktop.
Save spryffee/249ecfc10e08d6dcd3dc889a18f127bd to your computer and use it in GitHub Desktop.
recover root password in CentOS
e # boot to the GRUB edit mode
quiet ... rd.break # rd.break at the end of the line starting with kernel=
ctrl-x
mount -o remount,rw /sysroot/
chroot /sysroot
passwd
touch /.autorelabel # update selinux information
exit
logout
# wait for the file-system relabeling to complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment