Raspberry Password Related
Reset lost admin password for Raspberry Pi¶
I run into several problems when i was trying to connect with the raspberry using VNC viewer, this time was because i forgot the password that I set up so i found a way to reset the password.
With access to the desktop raspberry¶
If we have access to the desktop or to the terminal of the raspberry we will need just to use the command
It will ask for the new password and later the confirmation.
Without access to the desktop¶
We we don't have access at all we will need to modify some files in the SD card
- Power down the unit, remove the SD card, and put it in a computer.
- Open the file cmdline.txt and add
init=/bin/sh/
. - Put the SD card in the unit again and boot it up.
- when the unit boot up type
su
that will log you as root but you wont need the password. - type
passwd pi
- Power down the unit, remove the SD card, use the computer again and remove the line
init=/bin/sh/
. in the cmdline.txt.
If the process is not working it might be because the boot process is in read-only, in that case is is necessary to write in the terminal