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
(Removerhgb
andquiet
tags if necessary) > Ctrl+x/usr/sbin/load_policy -i
mount -o remount,rw /
passwd root
orpasswd
mount -o remount,ro /
B method:
- Grub > e
rd.break
> Ctrl+xmount -o remount,rw /sysroot/
chroot /sysroot/
passwd root
orpasswd
touch /.autorelabel
Which 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?