Yes, sometimes you just forget it and probably you already read this on the web, but let’s just be sure about that.
- in grub screen press ‘e’ to edit
- in kernel line, at the and append: init=/bin/bash (to see how your cmdline looks like, just type: cat /proc/cmline)
- Done that, wait for it.
- mount -o remount,rw /
- passwd root
- touch ./autorelabel (For fedora, because SELinux)
- and enjoy it.