Posts: 3
Joined: Sun Dec 09, 2018 2:12 pm

How to reset password in a customized Raspbian?

Sun Dec 09, 2018 4:02 pm

For my project, I need to modify a Raspberry Hat ( that requires their version of Raspbian to be downloaded and loaded as the Rasbperry PI OS. To get to this point, I need to change the password to get into the Raspbian system. I followed an online source stating to change config.txt by adding "init=/bin/bash" at the end of the line to get into the single user root mode which is successful.

Then comes the problem, when I entered "passwd pi" to change the password of the default user, the error message shows
"Authentication token manipulation error"
I follow another instruction to enter "Mount –o remount,rw /", another error message shows


Did I missed out anything? Or is there a better way to change the password in a customized Raspbian? I am looking into now and I am not sure I understand anything :/.

Posts: 1
Joined: Thu Jun 13, 2019 9:42 pm

Re: How to reset password in a customized Raspbian?

Thu Jun 13, 2019 10:09 pm

Don't know if you still need this but I had a similar issue when I had to recover password for Raspbian Stretch lite
I started following reset-forgotten-raspberry-pi-password where the command mount –rw –o remount / didn't work in my case. I got the message "mount: can't find PARTUUID=blahblah".

What worked for me in the end, was editing the cmdline.txt by also adding "rw" in the beginning of the file. So the one line looked like:

Code: Select all

rw wc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait init=/bin/sh
As "rw" boots the root device in read-write (source), I could immediately use the command passwd pi.
After changing the password I followed the other commands sync and exec /sbin/init.
When it rebooted, I shut the Pi down and removed "rw" and "init=/bin/sh" from the cmdline.txt.

With that done, I could use my new password :)

Return to “Beginners”