Skip to main content

How to reset root password?

being asked how to reset root password. I told:
reboot to single user mode, and passwd root

I was told: wrong, I need to mount the partition first.

1) if someone left the company, you still have root access, just use:
passwd root, that will do it.

2) if you forget or being changed, and you have the machine,
boot into single user mode, no need to mount anything, just passwd root
with grub, you need to append single to boot into single user mode

3) if you like to boot using cdrom into linux rescue mode, that would be fine too. this time, you need to mount /mnt/sysimage and issue passwd root.