Before Linux starts up, you need to get into the GRUB bootloader and
edit the boot options.
If the system doesn’t normally show the boot options when starting
up, you can force them to be shown by holding down the
‘Shift’ key during the boot process.
When the boot options appear, press the ‘e’ key to edit
them.
Use the boot option editor to replace ‘ro quiet splash’ with
‘rw init=/bin/bash’.
Press ‘Ctrl + X’ to start the system with the altered boot
options.
The system will start up and provide a Bourne shell command prompt.
Type ‘passwd root’ to change the root password to something
memorable.
Type ‘passwd username’ to change the password on the
specified username’s account to something memorable.
Note: This process makes it looks easy to bypass Linux security, but any
user who wants real security should have an encrypted home folder so
that nobody can access their important data without the required
key.