Fedora
- Press ESC at the GRUB prompt.
- Press e for edit. Highlight the line that begins kernel or linux press e
- Go to the very end of the line and add
rw init=/bin/bash
- Press Ctrl+X to boot or Press Enter, then press b to boot your system.
mount -o remount,rw /Takes 5 minutes to restart
passwd root
touch /.autorelabel
sbin/reboot -f
Ubuntu
Boot into recovery mode then select shell.mount -o remount,rw /
passwd root
exit
General
passwd -d root # to delete