These instructions apply not just to a Raspberry Pi, but many Linux distributions. If you forgot the password to your Pi, worry not, it’s possible to reset it without re-installing.
- Take the SD card out of your Pi and plug it into another computer with an SD card reader.
- Open the SDCARD/etc/shadow file on your Raspberry Pi
Look down the list for your user name. It should look like this.
Delete everything between the first and second colon (:)
Save the shadow file.
You just blanked out your password. Plug the SD card back into your Pi and boot up.
You should now be able to sign in using a blank password.