Forgot username and password


13 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: 11
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: 3462
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: 809
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: 3462
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.
http://goo.gl/TAUaLS - List of games that work on the Pi.
User avatar
Posts: 772
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: 2040
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
by Mr.Mancardo » 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?
Posts: 4
Joined: Sat May 17, 2014 12:30 pm
by klricks » 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://home.budget.net/~klricks/Comp/RPi/Rpi.html
Posts: 1328
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
by rpdom » 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.
Posts: 3421
Joined: Sun May 06, 2012 5:17 am
Location: Essex, UK
by ultimatepi » 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
Raspberry Pi Model B 256MB with Heatsink at 700MHz running Raspbian Wheezy
Raspberry Pi Model B 256MB at 700MHz (Headless Internet Radio)
Raspberry Pi Model B+ 256MB at 700MHz running Raspbian Wheezy with XBMC
Posts: 252
Joined: Sun Aug 04, 2013 12:09 pm
Location: Suffolk, United Kingdom
by DeeJay » 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
Posts: 2033
Joined: Tue Jan 01, 2013 9:33 pm
Location: East Midlands, UK
by DougieLawson » 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.)
Hacker on ZX80 and Microtan65
Unemployed mainframe database specialist.
Linux hacker since 1995.
RPi owner since 2012.
Twitter: @DougieLawson

Gaffer tape is "The Force", it has a dark side and a light side and it holds the Universe together.
User avatar
Posts: 5868
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK