If you forget your Raspberry Pi’s password, it’s a pretty useless little machine.
All you oughta do is grab your Raspberry Pi’s SD and put it into your rig.
There should be a file called cmdline.txt.
Boot up and you should get a flashing cursor.
Enter this command into the Pi:
passwd pi
Enter in your new password two times.
Then jot down this command:
sync exec /sbin/init
Your Pi will boot up like normal.
When it’s done, shut it back down, and take your SD card back to your system.
Delete the line in the TXT file you added above.
That should be it, you’re able to access your Pi again.
Head over to Raspberry Pi Spy for a more detailed walkthrough.
How to Reset a Forgotten Raspberry Pi Password| Raspberry Pi Spy