So recently I’ve decided to overhaul my home network, one of the requirements for this is I needed a DHCP and DNS server running, as I had already setup a Raspberry Pi last year with Blynk I decided I could use this for my DHCP and DNS too.
Now the Pi itself wasn’t currently running as my Blynk project is on hold until the summer, booted it up, and even though I ‘know’ the password… it seems I don’t..
Okay, no big issue. Due the the nature of Raspberry Pi’s its quite easy to reset. Shutdown your Pi, remove the memory card and place this into your PC.
On the Boot drive you should see a file called cmdline.txt, open this file (I used VS Code as notepad sometimes creates side effects). At the end of the line add a space followed by;
Save the file, remove the card and place it back into the Pi. Boot the Pi. Once at the prompt (you are now in single user mode), type:
Now at this point you could just type:
to reset the password, but sometimes you need to mount first, so I always do it in this order (including the forward slash, then enter):
mount -rw -o remount /
Follow the prompts.
Shutdown the Pi, take the memory card out and put it back into the PC, edit the cmdline.txt file again and remove the text you put in before, save, and put it back into the Raspberry Pi and boot.
Now you should be able to in as Pi with your new password
(Of course this security hack could be done by anyone who has physical access to your Pi…)