Thursday, January 02, 2020

Reset Raspberry Pi password

Forgot password - reset it by booting into single user mode as given at http://mapledyne.com/ideas/2015/8/4/reset-lost-admin-password-for-raspberry-pi

  • Take out the SD card after powering down the Pi
  • Edit the cmdline.txt and add to the end init=/bin/sh
  • Once the Pi boots into single user mode, just su to become root, no password, and then do passwd pi to reset the pi user's password.
  • Then again take out the SD card after powering down, remove the init phrase from cmdline.txt

The link above also has troubleshooting tips like mount -o remount,rw /dev/mmcblk0p2 / etc. Also, if root pw is set, , replace contents of /etc/shadow with * to make it blank as above.

SD card was read-only with the laptop's built in reader. If an external card-reader was used, it could be written to. The issue was something else, not a chown issue or a hardware switch as in the following: https://ubuntuforums.org/showthread.php?t=2400119

Also, changed the auto login by editing /etc/lightdm/lightdm.conf

No comments:

Post a Comment