Tuesday, March 15, 2016

Lost your Raspberry Pi Password?

I dug out my old Raspberry Pi "WarPi" gear today, as it was high time for a refresh. And of course, then it hit me... I forgot the password. What to do? I have hours into this device building Kismet (fixing a double conversion issue), hooking up the GPS, etc.

Well never fear - my buddy Chuck helped me through it. It's a snap:

  1. Pull the SD card
  2. Mount it somewhere else (I use a Mac, but you can mount it on Windows or Linux or what have you)
  3. Open the "cmdline.txt" file
  4. Add "init=/bin/sh" to the end of the FIRST line. 
  5. Save "cmdline.txt" again, unmount/eject the SD card and reboot the Pi
  6. When you get to the command prompt, type "mount -rw -o remount /"
  7. Next, type passwd pi and reset your password
  8. Next, type sync
  9. Then exec /sbin/init
  10. Finally, reboot (you can use sudo halt)
Now log in as usual.

No comments:

Post a Comment