Wednesday, October 23, 2013

Can't login to paspberry pi; raspi-config design bug

It's a second time I stumbled upon this issue. It's funny that the first time was so long ago that I forgot about it completely and had to troubleshoot the issue from scratch again. This is a good reason to finally write it down.

After you get a new version of raspbian image copied to your SD card and boot up the RPi, you'll be greeted by the raspi-config utility. It'll offer you to do a lot of things and, naturally, you'll follow the menu options from top to bottom. So, among the first things you'll do will likely change the password. Then, a few line down, if you're not in UK, you'll change the keyboard layout from the UK (default) to whatever (US in my case.) For the most cases it'll go smooth; however, there are occasions when it won't. What if your password contains a symbol character, say # (Shift-3 in US layout)? While still in the UK keyboard layout, this would be a British pound (currency symbol.) After you change your layout to say US, typing Shift-3 won't produce British pound sign anymore, rather #. So, the password is incorrect and you unreasonably keep calling yourself stupid for forgetting your password (as quite a few people did on RPi forums.)

So, now your only option is to power off RPi, pull out the SD card from RPi, insert it into another computer, open /boot/cmdline.txt, and append init=/bin/sh. Then unmount SD, insert it into RPi and power on. Upon boot up, the screen will look like RPi froze in the middle. Don't worry, it loaded the shell but for some reason did not show up the shell prompt. Just press Enter, and the shell prompt will show up. Now, type
    passwd pi
and Raspbian will ask you to change the password. Since you have your desired keyboard layout now, you can go ahead and enter any non-alphanumeric characters you want for your password. Unless you decide to change your keyboard layout again, you should be safe. Finally, you need to undo the change you made to /boot/cmdline.txt so that your RPi boots normally.

P.S.: what's the raspi-config design bug you ask? Well, IMHO, the sequence of steps should first offer you to change the keyboard layout, and then the password, not the other way around.

7 comments:

  1. Puja shaha said :

    CCIE Rack Rental

    Welcome To The BEST CCIE RACK RENTAL Site! CCIE Rack Time has 24 hour access to the variety of labs. You will find our labs will complement your workbooks. We want you to succeed and Count on us to be your main lab rack time company. We provide the latest hardware and software which meets Cisco standards to get you ready for your certification test. please visit: www.ccieracktime.com

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
    Replies
    1. This article is very good thins.Thank you for post.

      CCIE Rack Rental

      Delete
    2. Just google UK keyboard to determine what you typed. Worked for me. Shift 2 is double quote!

      Delete
  3. violation management


    We take the frustration out of parking management for Apartments, Home Owners Associations, Condominiums, Townhouses Co-ops, and other parking areas. www.Webparkingsoftware.com has reinvented how parking management should be done and more information then contact us :

    CBT SOLUTIONS, INC.
    23785 El Toro Road Suite 122
    Lake Forest, CA 92630
    call : 1-855-228-0411

    ReplyDelete