Change Raspberry Pi lost password

Too much on a hurry when I choose my Raspberry Pi password, and I wrongly noted it. There is a way to reset the pi user password.

  1. Insert the card in your Mac SD card reader (must work on Window too);
  2. Edit the file “cmdline.txt” and append “init=/bin/sh” (thanks Joe Schmoe). The Rpi will boot in single user mode;
  3. Insert the card in the RPi again and boot up;
  4. When prompt available, enter “su” to log as root (with no password);
  5. Type “passwd pi” and enter a new password;
  6. Remember the new password;
  7. Remove the appended string in the “cmdfile.txt” file. Voila!

If you need a password for the root and you don’t have it either, edit the “/etc/shadow” file and replace the root password with a asterisk. Then it will be no password for the root user. (not tested yet).

This entry was posted on Monday, October 29th, 2012 at 20:01 and is filed under Raspberry Pi. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

One Response to “Change Raspberry Pi lost password”

  1. Ken leggo Says:

    If one has edit the long line after entering the edit mode so one has 3 line to read this string, after adding “init=/bin/sh” one must put the sentance back to the long line by using the backspace key.

Leave a Reply

Internet to Serial Proxy for the USB Arduino and others...