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?

techraf
  • 4,319
  • 10
  • 31
  • 42
CCK
  • 181
  • 2
  • 3
  • 8

8 Answers8

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!

LuWi
  • 972
  • 5
  • 10
  • I don't see any cmdline.txt file – CCK Apr 28 '14 at 21:21
  • it should be on a seperate partition - sometimes calles 'boot' or similar. – LuWi Apr 28 '14 at 21:22
  • We only see one partition called Recovery – CCK Apr 28 '14 at 21:23
  • I see recovery.cmdline, is that different? – CCK Apr 28 '14 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 '14 at 21:25
  • Yes from a windows pc – CCK Apr 28 '14 at 21:26
  • the file type of that recovery.cmdline is CMDLINE File i can't open it with a notepad. T_T – CCK Apr 28 '14 at 21:28
  • can you tell me a list of files/folders you have on that partition? you should be able to open it by opening a new file in notepad and then click file - open. – LuWi Apr 28 '14 at 21:29
  • i opened it on notepad and this was the text inside the recovery.cmdline quiet vt.cur_default=1 coherent_pool=6M elevator=deadline – CCK Apr 28 '14 at 21:32
  • Files are defaults (folder), os (folder), bootcode, BUILD-DATA, INSTRUCTIONS-README, recovery.cmdline, recovery.elf, recovery, recovery.rfs, RECOVERY_FILES_DO_NOT_EDIT, riscos-boot – CCK Apr 28 '14 at 21:33
  • Can i just create it? the cmdline.txt? – CCK Apr 28 '14 at 21:36
  • it shouldn't hurt, give it a try. But I just looked again, the parition showing up on my windows machine is called "boot" and has the cmdline.txt file on it. also, "riscos-boot" sounds like risc os which which I have no experience, sorry. – LuWi Apr 28 '14 at 21:38
  • am i going to crash the system if i create that cmdline.txt? – CCK Apr 28 '14 at 21:39
  • try opening another question asking for that, I have no idea why your filesystem looks completely different than mine. – LuWi Apr 28 '14 at 21:42
  • I found this forum and its related to my problem. http://www.raspberrypi.org/forums/viewtopic.php?t=64653&p=476555 – CCK Apr 28 '14 at 21:47
  • Did i understand that right? That I need to get to recovery mode then open the file there? – CCK Apr 28 '14 at 21:48
  • Went to recovery and still did not see that cmdline.txt file. I wonder if I did anything wrong when we set it up. – CCK Apr 28 '14 at 22:00
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.

Milliways
  • 59,890
  • 31
  • 101
  • 209
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!

techraf
  • 4,319
  • 10
  • 31
  • 42
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.

george
  • 11
  • 1
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.

Darth Vader
  • 4,206
  • 24
  • 45
  • 69
del01
  • 11
  • 1
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

  • 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 '19 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

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