I know several ways to reset root user's password, but want to know which is the best and why it is. For example: A method:Grub > 'e'init=/bin/sh (Remove rhgb and quiet tags if necessary) > ctrl+x/usr/sbin/load_policy -imount -o remount,rw /passwd root or passwdmount -o remount,ro /B method:Grub > 'e'rd.break > ctrl+xmount -o remount,rw /sysroot/chroot /sysroot/passwd root or passwdtouch /.autorelabelWhich is the best? Why is it best? I'm preparing for RHCSA (Red Hat Certified System Admin) exam. I need to know the relative merits of each approach. Is one of them more portable? Safer? Is there a reason to choose one over the other?
What is the difference between these two ways of reseting the root password?
password;root
I think the best way is as is shown in Red Hat documentation.This is your second method. For GRUB2/RHEL7 single/emergency mode should not work since it will use sulogin to authenticate you before presenting the command prompt.  So lets mark off different methods.  For RHEL5, RHEL6, append 1, s or init=/bin/bash to kernel cmdlineFor RHEL 7, append rd.break or init=/bin/bash to kernel cmdlineIt appears that the second method is not available on RHEL5 and RHEL6. But for RHEL7 I will prefer the first because adding init=/bin/bash is a bit tricky when single mode is password protected and may be appending rd.break is a way to standardize it.