Forgot username and password


7 posts
by PeterPi09 » Fri May 17, 2013 4:55 pm
Everytime I boot up my pi I receive the login prompt. Since I haven't used my pi in ages I forgot my Username and PWD I made up myself. Any tips to bypass the login?
Posts: 10
Joined: Mon Dec 31, 2012 2:03 am
by redhawk » Fri May 17, 2013 5:03 pm
username: pi
password: raspberry
(passwords are not echoed on the screen don't expect any *s when typing).

Richard S.
User avatar
Posts: 2927
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1
by DirkS » Fri May 17, 2013 5:06 pm
redhawk wrote:username: pi
password: raspberry

Probably not; quote from OP:
I forgot my Username and PWD I made up myself.
Posts: 375
Joined: Tue Jun 19, 2012 9:46 pm
Location: Staffordshire, UK
by redhawk » Fri May 17, 2013 5:19 pm
Without the password then your system is screwed, however it should be possible reset the pi password back to it's default.
You'll need to mount your file system using an SD card reader with another Linux machine or even another Pi running Linux.
I believe the password file is stored in somewhere like /etc/passwd the actual password is the gibberish that's appended at the end of each account name.
If you cut and past the gibberish from a working Pi passwd file and paste this into your faulty Pi OS passwd file then your password should revert back to "raspberry" again.

Richard S.
User avatar
Posts: 2927
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1
by mrpi64 » Fri May 17, 2013 5:46 pm
nice profile pic redhawk :D
I'm happy to help.
bit.ly/hacking-mcpi-guide
http://bit.ly/games-that-work-on-the-pi
User avatar
Posts: 586
Joined: Sat Feb 16, 2013 5:13 pm
by jojopi » Fri May 17, 2013 6:13 pm
It is not normally necessary to take the hard disk out of a Linux computer, and put it into another Linux computer, just to change a password. You adjust the bootloader configuration.

Now, admittedly, to change the bootloader configuration on a Pi may require to take the SD card out and put into another computer. But at least the other computer does not need to be running Linux.

If there is no root password set then add the word "single" to cmdline.txt, keeping it on one line. The system boots in single user mode. Use "passwd pi" to change pi's password; "nano /boot/cmdline.txt" to restore boot settings; and Ctrl+D to switch to multi-user mode.

If there is a root password, and you have forgotten that too, then add "init=/bin/bash" to cmdline.txt. Now the system boots directly to a root shell. Use "passwd pi" to change password; "nano /boot/cmdline.txt" to restore boot settings; and "reboot -f" to reboot.

There is also a pi-specific method that does not need another computer. Boot in safe mode. Access the main filesystem with "mount /dev/mmcblk0p2 /mnt"; "chroot /mnt /bin/bash". Then as for previous method, but no need to change cmdline.
User avatar
Posts: 1867
Joined: Tue Oct 11, 2011 8:38 pm
by grahambb » Sat Feb 08, 2014 2:03 am
This is not working for me. The boot process hangs at the USB logitech driver (that's the keyboard / mouse combo).

I'd welcome any help.

Cheers
Posts: 6
Joined: Fri Oct 11, 2013 9:06 pm
Location: Oakland, California