I've been watching the raspberry pi web server tutorial from tinkernut and I think I've lost the default pi user, my ROOT password isn't working either. How can I recover the and regain access?
you may easily recreate any user by connecting your SD card to any linux computer where you have root access, then edit
/etc/group files to add the corresponding line.
you may even use your RasPi for that purpose, provided you have another SD card to boot from and USB SD card reader to insert the broken one into the USB slot.
Connect the SD to a PC running Linux (even a LiveCD distribution - you don't need to install it on your hdd)
etc/passwd (not /etc of your Linux, but the root of the card, it may be /media/sdb/etc/passwd or something like this depending on your distribution) if it isn't there, or edit it to match the above if the line is already there.
add or replace
etc/shadow correspondingly. This restores the user with the default password
OTOH, if you did very little with the system, re-flashing the whole SD might be easier.
If you can't remember the password then you'll have to re-install your OS. Do so by formatting the SD card then using a disk imager to install the OS. However you will lose all the files and installations previously on the Pi.
protected by Ghanima♦ Dec 10 '16 at 18:00
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?