PeterPi09
Posts: 11
Joined: Mon Dec 31, 2012 2:03 am

Forgot username and password

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?

User avatar
redhawk
Posts: 3465
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1

Re: Forgot username and password

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.

DirkS
Posts: 7548
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Forgot username and password

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.

User avatar
redhawk
Posts: 3465
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1

Re: Forgot username and password

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
mrpi64
Posts: 931
Joined: Sat Feb 16, 2013 5:13 pm

Re: Forgot username and password

Fri May 17, 2013 5:46 pm

nice profile pic redhawk :D
I'm happy to help.
https://www.raspberrypi.org/forums/viewtopic.php?f=78&t=51794 - List of games that work on the Pi.

User avatar
jojopi
Posts: 2993
Joined: Tue Oct 11, 2011 8:38 pm

Re: Forgot username and password

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.

grahambb
Posts: 6
Joined: Fri Oct 11, 2013 9:06 pm
Location: Benicia, California
Contact: Website

Re: Forgot username and password

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

Mr.Mancardo
Posts: 4
Joined: Sat May 17, 2014 12:30 pm

Re: Forgot username and password

Sat May 17, 2014 12:41 pm

I have the same problem as Grahambb. I haven't used my raspberry pi in a year.But all the solutions I have seen don't work. This is frustrating because I don't have another Linux machine either!
Can you help me?

klricks
Posts: 4765
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: Forgot username and password

Sat May 17, 2014 1:47 pm

Mr.Mancardo wrote:I have the same problem as Grahambb. I haven't used my raspberry pi in a year.But all the solutions I have seen don't work. This is frustrating because I don't have another Linux machine either!
Can you help me?
If you have a Windows computer you can use a Linux live CD's or USB stick and temporarily boot to Linux without installing it. Then fix the SD card. When done, reboot the PC without the boot media and it will be back to normal. There are many Linux distro's that offer a 'live' boot option you can download.
Go here for my RPi writeup. Basic config, Serial Port add-on etc:
http://blackeagle12.net/Comp/RPi/Rpi.html Click contact icon then world icon --->

User avatar
rpdom
Posts: 11569
Joined: Sun May 06, 2012 5:17 am
Location: Essex, UK

Re: Forgot username and password

Sat May 17, 2014 3:39 pm

Are you sure it is hanging?

Usually when booting in safe mode the last thing you will see on the screen is messages about USB devices, then it appears to stop.

Pressing Enter should give you a "#" prompt where you can type commands.

Alas, I heard that safe mode is being dropped from future images as it was often getting triggered erroneously by some hardware.

ultimatepi
Posts: 271
Joined: Sun Aug 04, 2013 12:09 pm
Location: Suffolk, United Kingdom

Re: Forgot username and password

Sun May 18, 2014 10:21 am

Hi there

Once you have got it back to default, I wouldn't suggest changing it unless you really want to as your Pi won't get hacked.

ultimatepi
I am still learning the world of Raspberry Pi, apologies if I double post.

I've learnt one thing about Raspberry Pi: You fix an issue, but then you discover another.

User avatar
DeeJay
Posts: 2027
Joined: Tue Jan 01, 2013 9:33 pm
Location: East Midlands, UK

Re: Forgot username and password

Sun May 18, 2014 11:50 am

ultimatepi wrote:Hi there

Once you have got it back to default, I wouldn't suggest changing it unless you really want to as your Pi won't get hacked.

ultimatepi

Irresponsible advice, since you cannot know anything about the network environment the enquirer's RPi is connected to, or what network services (daemons) are enabled. ANY device capable of accepting a remote network connection can potentially be hacked.
How To Ask Questions The Smart Way: http://www.catb.org/~esr/faqs/smart-questions.html
How to Report Bugs Effectively: http://www.chiark.greenend.org.uk/~sgtatham/bugs.html

User avatar
DougieLawson
Posts: 29790
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: Forgot username and password

Sun May 18, 2014 12:00 pm

ultimatepi wrote:Once you have got it back to default, I wouldn't suggest changing it unless you really want to as your Pi won't get hacked.
Or better, set a strong password for root, set a strong password for pi, consider renaming the pi id to something personal and remove pi from the sudoers file (or better restrict the commands pi can run with sudo).

It's safe to keep passwords in one of those Windows password keeper programs (I use keepass). If you can be sure of physical security then a password written on a post-it note is safer than your proposal. (Basically, if I can steal your SDCard all bets are off regardless of whether you disclose the password so a password on a post-it is no extra risk.)
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

Since 2012: 1B*5, 2B*2, B+, A+, Zero*2, 3B*3

Please post ALL technical questions on the forum. Do not send private messages.

Jfurlong
Posts: 1
Joined: Wed Nov 30, 2016 8:59 am

Re: Forgot username and password

Wed Nov 30, 2016 9:03 am

There is another way:

If you get stuck booting to scratch, press ctrl+alt+F2 to get out of scratch and back to the boot window. Then press ctrl+c to interrupt the process. Then press ctrl+c again to cancel the shutdown of the system. From there, type 'raspi-config' and go to the second option and change the password for the 'pi' user. Now go to the third option and start with login required and use the 'pi' user and your new password to log in. Once you log in to the terminal, run the $ raspi-config command again and you can now change it to Enable a lot to Desktop Log in as 'pi' at the graphical desktop. Boom! No need for another computer...

Return to “Troubleshooting”

Who is online

Users browsing this forum: Bing [Bot] and 61 guests