3

I'm trying to follow the directions in https://howtoraspberrypi.com/recover-password-raspberry-pi/.

(For future reference in case that tutorial disappears, here is the steps up to the point which I ran into trouble.)

  1. Remove SD card from Raspberry Pi (after powering off the Raspberry Pi).

  2. Plug into SD card reader on computer.

  3. Go to the root partition on the SD card and edit the contents of cmdline.txt

  4. Add init=/bin/sh to end of line, and save and close.

  5. Remove card and place back in Raspberry Pi. Connect keyboard and monitor to Raspberry Pi and start Raspberry Pi.

  6. Wait until screen freezes than type in mount -o remount, rw / to mount the root partition.

However, when I start up the raspberry pi after editing the cmdline.txt file and connecting a monitor and keyboard, it never gets to the point where I can type text. I see it booting up and then the screen goes blank.

This is the contents of the cmdline.txt:

dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles

Edit: Sometimes when I press some key on the keyboard, I am able to get a prompt:

hostname login:

I don't remember the password, so how do I get past that point?

To add, this runs on Raspbian Jessie.

user3273814
  • 182
  • 9

1 Answers1

1

There is another way to reset a password. If you have attached the SD Card from the RasPi to your computer you can also modify etc/passwd and etc/shadow on the root partition. This partition is formated with an ext4 filesystem so you have to use a computer that can read this. Any linux operating system can, MS Windows and MacOS can't. How exactly modifiy the files you can look at Raspian gui unable to log in.

Ingo
  • 42,961
  • 20
  • 87
  • 207