You can reset a forgotten Linux password by using the following steps:
- When you start up your computer the GRUB menu should appear, but if it
isn’t normally displayed you can make it appear by holding down
one of the ‘Shift’ keys while the computer starts.
- Press the ‘e’ key to edit the start-up command sequence.
- Use the arrow keys to highlight the command line that begins with the
word ‘kernel’.
- Use the right-arrow key, or the ‘End’ key, to move the
cursor to the end of the line.
- Replace the part at the end of the command line with ‘rw
init=/bin/bash’.
- Press ‘F10’ or ‘Ctrl + X’ to start up the
computer using the modified command sequence.
- Once the computer has started up, you will be presented with a command
prompt that has ‘root’ privileges.
- Type ‘passwd userName’ to set a new password for
the specified account.
- Enter the new password.
- Restart the system normally.