5

I disabled the auto-login on our Raspberry and on raspi-config changed it to boot to console instead of booting straight to desktop, now its asking us to login first before booting up to the desktop (which is what we want) now the problem is the default login is not working:

pi
raspberry

I know I didn't change any passwords yet. Is there a way for us to boot back to the configure settings so we can change it to boot to desktop and then set the user password there?

2
  • we're still talking about raspbian, right?
    – LuWi
    Apr 28, 2014 at 21:36
  • yes we are still on raspbian
    – CCK
    Apr 28, 2014 at 21:36

8 Answers 8

2

I'm sorry my previous answer caused this trouble, and I hope this will fix it!

You could try putting the SD-Card into a different computer and change the cmdline.txt to something like this: (Tutorial by TNET Raspberry Pi pages)

dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 
console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait init=/bin/sh

(I added the init=/bin/sh). Then try to reboot, and hope that you get a shell. Here, you need to mount the filesystem:

mount -o remount,rw /
passwd pi
(enter a new password)
sync
exec /sbin/init

Then, you should be able to log in again, using pi and your newly set password. At the end, make sure to change the cmdline.txt back to the original. Good luck!

17
  • I don't see any cmdline.txt file
    – CCK
    Apr 28, 2014 at 21:21
  • it should be on a seperate partition - sometimes calles 'boot' or similar.
    – LuWi
    Apr 28, 2014 at 21:22
  • We only see one partition called Recovery
    – CCK
    Apr 28, 2014 at 21:23
  • I see recovery.cmdline, is that different?
    – CCK
    Apr 28, 2014 at 21:25
  • are you looking at the sd card from a windows pc? recovery.cmdline - I don't think that's what you're looking for, but you might as well try. (make a backup of your sd card prior to that, of course)
    – LuWi
    Apr 28, 2014 at 21:25
2

You obviously had NOOBS installed, which has 2 partitions.

DO NOT touch Recovery, which has all the distributions.

If you had installed Raspbian from NOOBS you should still have the /boot partition.

You could always try booting to NOOBS. I think by holding down the Shift while booting.

2

For Raspbian:

If you are locked out and the password for user pi doesn't work, you should try to reboot to recovery by pressing Ctrl+Alt+Del and then holding Shift while it will boot up.

Then you should see the recovery screen and on top there will be a button to edit config. Go there and switch to the tab to edit cmdline.txt.

Add init=/bin/sh to the end of the line, press OK and then press the GUI button Esc - that will just reboot with the edits you did

When it stops booting press enter - you should see a line with # sign. That's when you input the commands to mount the file system and reset password:

mount -o remount,rw /
passwd pi
(enter a new password)
sync
exec /sbin/init

After you logged in with the new password and if you're not comfortable with VIM, you can repeat the reboot sequence, go back to the GUI and remove the init=/bin/sh from cmdline.txt

Otherwise do:

sudo vi /boot/cmdline.txt

good luck!

1

I had the same problem on the QEMU emulator. Where:

pi::raspberry

did not work as the username::password combination. I typed

root

for the username and it took me right in.

1

None of the above worked for me. What I found, posted on another forum was this:

Hi, I'm a newbie who had the same problem. It was caused by running xstart from terminal as root. This changed the ownership of file /home/pi/.Xauthority to root which killed the auto login with identical symptoms to the other posts on this topic. I changed ownership back to pi with command "chown pi:pi /home/pi/.Xauthority" (while logged in as root) and everything worked ok after that. Hope that saves someone else the hours I spent trying to figure out the problem! Cheers, Greg.

by gregmackers » Sat Aug 27, 2016 4:04 pm

chown pi:pi /home/pi/.Xauthority resolved the problem for me.

1

Check your keyboard settings!

On default, it is set to en-us. In my case, the Z and Y are switched (german keyboard). And the result is: raspberrz

1
  • The default is not set to en-us, the default is set to en-gb which differs from en-us, mostly my special characters.
    – 88weighed
    Jan 23, 2019 at 12:17
0

If you really can't get into the Pi, and don't mind factory resetting your Pi and reinstalling Raspbian, then hold the Shift key during boot (at the Raspberry with a gray background)

Raspberry Pi recovery screen entry

Then you'll be back to a screen just like the NOOBS Installer. Just reselect Raspbian and finish the reinstallation. Everything should be back to defaults and you should be back at the Raspbian Desktop.

-1

try typing the following

sudo passwd

(will ask for new password)

enter new password, and again to confirm

when installing files, make sure you choose username as root, then type in your newly entered password

1
  • u need to have. already logged in to do this. his problem is that he can't login
    – ngb
    Feb 10, 2021 at 6:13

Not the answer you're looking for? Browse other questions tagged or ask your own question.