What would you think if I told you that there is a possibility to access a system as root without the corresponding credentials, but with physical access to the equipment?
This trick consists of pressing the e key to edit the entry you want to boot, at the end of the line where the kernel is specified, add rw init=/bin/bash. You can also add single to enter the system in single-user mode as root. Press b to boot and voila, the system will magically start with root permissions.
If we want to change the root password, we need to mount the / partition with the remount option:
Change the password
GRUB allows us to assign a password to protect the editing of boot entries:
password PASSWORD
Actually, this “trick” consists of booting /bin/bash instead of init, which would go through the services in the runlevels and so on.