Page 1 of 1
(HELP) forgot password and I cannot change it!
Posted: Sun Mar 04, 2018 7:28 pm
by Pizzachu22
Hello there. During the summer, my school held a raspberry pi camp and that's how I got my Pi3. Fast forward to march 2018 where we went ahead and set it up with a monitor and some old 90's-ish speakers. Today. I went ahead to try and install some software but I needed a password. However, since I had gone multiple months without use of my pi, I forgot my pi's password. Now I cannot change it and therefore cannot install anything If there is someone out there with a solution, let me know.
Re: (HELP) forgot password and I cannot change it!
Posted: Sun Mar 04, 2018 8:42 pm
by DougieLawson
Get another SDCard and a USB reader.
Build a fresh copy of Raspbian Stretch on the new SDCard. Boot that in your RPi. Open an LXTerminal and get root authority shell with sudo -s.
Mount the borken card in the Reader. Insert the reader in your RPi. The automounter will pop-up, cancel any windows that pop-up.
Run
for i in /dev/sda*
do
umount $i
fsck -f -y $i
done
ignoring any errors.
Mount the rootfs (/dev/sda2 if not NOOBS, /dev/sda6 if it is NOOBS) with
mount /dev/sda2 /mnt # or mount /dev/sda6 /mnt
Mount some special filesystems
mount -t proc /proc /mnt/proc
mount -t sysfs /sys /mnt/sys
mount -o bind /dev /mnt/dev
Change to the /mnt directory and chroot the /dev/sda filesystem.
cd /mnt
chroot . # there's a full stop on the end of that one.
You now have the original card's filesystem available and you're running as root. Use
passwd pi
and follow the prompts to reset your pi password to a known string.
Exit the chroot, unmount everything. Poweroff, swap cards and you're good to go.
exit # the chroot not the root shell
for i in dev proc sys
do
umount /mnt/$i
done
umount /dev/sda2
eject /dev/sda
poweroff
Re: (HELP) forgot password and I cannot change it!
Posted: Sun Mar 04, 2018 10:09 pm
by n67
Or you can use the "-R" option in passwd, saving yourself all that manual work.
Re: (HELP) forgot password and I cannot change it!
Posted: Sun Mar 04, 2018 11:42 pm
by davidcoton
If you never set a personal password, then the pi account has password "raspberry".
Re: (HELP) forgot password and I cannot change it!
Posted: Mon Mar 05, 2018 4:39 am
by HawaiianPi
davidcoton wrote: ↑Sun Mar 04, 2018 11:42 pm
If you never set a personal password, then the pi account has password "raspberry".
Yup, try raspberry