Skip to content

Instantly share code, notes, and snippets.

@dcode
Created February 25, 2016 17:43
Show Gist options
  • Select an option

  • Save dcode/02dc585ac3fed5b678f2 to your computer and use it in GitHub Desktop.

Select an option

Save dcode/02dc585ac3fed5b678f2 to your computer and use it in GitHub Desktop.
How to reset root password on EL7 hosts.

The official training for RHSCA 7 describes the “change root password” procedure as below:

Append “rd.break” to the kernel command line that starts with linux16 (this will break just before control is handed from the initramfs to the actual system) (sometimes it is needed to delete also everything after “…mapper/rhel-root ro” and append here)

mount -o remount,rw /sysroot
chroot /sysroot
passwd
touch /.autorelabel
exit
exit

You are done.

Reference: http://www.tecmint.com/reset-forgotten-root-password-in-centos-7-rhel-7/#comment-512719

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment