i have not used my Pi 2 for a long time and but when I came to log in again the details I had were incorrect, How do I reset the log in and password details, on my machine ?
i have not used my Pi 2 for a long time and but when I came to log in again the details I had were incorrect, How do I reset the log in and password details, on my machine ?
There seems to be a solution described on Raspberry Pi forum: https://www.raspberrypi.org/forums/viewtopic.php?p=109612#p109612
Remove the SD card, insert it into a computer, edit cmdline.txt (make a backup) and add
init=/bin/sh
Then inserting the SD card back to the Pi and after getting the command prompt as root entering command
passwd pi
which lets you change the password of the default user.
After that, get back to the previous version of cmdline.txt and boot normally.
There seems to be a solution described on Raspberry Pi forum: https://www.raspberrypi.org/forums/viewtopic.php?p=109612#p109612
Remove the SD card, insert it into a computer, edit cmdline.txt (make a backup) and add
init=/bin/sh
Then inserting the SD card back to the Pi and after getting the command prompt as root entering command
passwd pi
which lets you change the password of the default user.
After that, get back to the previous version of cmdline.txt and boot normally.
On "normal" PC-Linux systems (*), you'd have to do an extra step :
mount -o remount,rw /
before the passwd command would be able to work. And after that all changes might stil be in memory. So
sync
and
mount -o remount,ro /
would be recommended before you reboot.
(*) Not 100% sure if this is true for raspbian as well, but I do expect so! The reason for starting out with root read-only is that you can safely fsck (relevant on PCs and PI) and resize the root (very relevant on first-boot-on-PI!) .