Reset A Forgotten Raspberry Pi Password With A Simple TXT File Edit

Reset A Forgotten Raspberry Pi Password With A Simple TXT File Edit

If you forget your Raspberry Pi’s password, it’s a fairly useless little machine. To fix this problem, Raspberry Pi Spy shows how to reset the password with a simple edit to a TXT file.

All you need to do is grab your Raspberry Pi’s SD and put it into your computer. There should be a file called cmdline.txt. Open that with a text editor and add this line to the end of the existing text:

init=/bin/sh

Save the TXT file and take your SD card back to your Pi. Boot up and you should see a flashing cursor. Enter this command into the Pi:

passwd pi

Enter in your new password two times. Then type 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 computer. Delete the line in the TXT file you added above. You should now be able 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]


The Cheapest NBN 50 Plans

Here are the cheapest plans available for Australia’s most popular NBN speed tier.

At Lifehacker, we independently select and write about stuff we love and think you'll like too. We have affiliate and advertising partnerships, which means we may collect a share of sales or other compensation from the links on this page. BTW – prices are accurate and items in stock at the time of posting.

Comments