Skip to content

Latest commit

 

History

History
23 lines (14 loc) · 1.3 KB

CanNotLoginToMyRPi.md

File metadata and controls

23 lines (14 loc) · 1.3 KB

I've Broken Something, and I Can't Login to my RPi

You can attempt to repair problems on the Pi by rebooting to a root shell. Here's how to do that:

  1. Remove the SD card from the misbehaving RPi, and mount it on another computer (N.B. the /boot partition is FAT-formatted, and it can be mounted, read and written by virtually any computer on earth.). The file you must edit is: /boot/cmdline.txt).

  2. Append init=/bin/sh at the end of cmdline.txt. Re-insert the modified SD card, and boot the system (plug in USB power cord).

  3. After booting you will be at the prompt in a root shell.

  4. Your root file system is mounted as read-only at this point, and so will need to re-mount it as read-write:

    mount -n -o remount,rw /
  5. You can now edit files anywhere on the SD card/root file system, incl. / - the root ext4 partition.

  6. Running raspi-config may be a good place to start; it will allow you to change your password, network settings, enable/disable SSH, change keyboard layout, etc.


REFERENCES:

  1. Changed keyboard layout & now can't enter password; Full credit to the effervescent @Milliways :)