Raspberry Pi password not working? Try these solutions

Reading time icon 3 min. read

Readers help support Windows Report. We may get a commission if you buy through our links. Tooltip Icon

Read our disclosure page to find out how can you help Windows Report sustain the editorial team Read more

Key notes

  • A rejected password for no apparent reason is one of the most frustrating issues that one can have with a Raspberry Pi, especially if they are newbies.
  • There are a few ways to get around this situation, and we're explaining how.
  • You can find similarly useful articles in our Raspberry Pi errors dedicated section.
  • Perhaps you also want to take a look at the Developer Tools Hub and bookmark it for easy access to all the updates.
password not working raspberry pi

Raspberry Pi is a great single-board computer, very compact, lightweight ad easy to use. But, like any other system, it has its drawbacks, namely a few frequent errors.

Among these, failure to recognize the password on the first boot or shortly after, as well as after ins. Sometimes, this happens at the first login: other times, after working fine with autologin for a while and the Pi asks again for credentials but won’t recognize the password.

If you happen to type it incorrectly, it will warn you. But if it fails to recognize it, it will just freeze.

What to do if the Raspberry Pi password is not working?

1. Modify the password file for new OS imagemodify password raspberry OS image

    1. Insert the SD card with the OS image in another device
    2. The card should contain a file named cmdline.txt
    3. Open it in Notepad (or other .txt file reader)
    4. Edit the text to have init=/bin/sh at the end. It should look like this:  dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=PARTUUID=04ceb741-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait init=/bin/sh
    5. Save and exit > Insert the SD card into the Raspberry Pi
    6. When prompted type: mount -o remount, rw / (and repeat if an error message appears)
    7. Type passwd pi
    8. Insert a new password
    9. Then type sync
    10. Type exec /sbin/init
    11. Save exit Raspberry Pi

Then put the card into the PC again and delete the init=/bin/sh combination you added. Save the changes and insert the card into the Raspberry Pi.

You should be able to use the new password.

2. Modify the password file for NOOBs

  1. Press Shift key while booting and the system will boot in the recovery mode
  2. Select your Raspbian image, and then click Edit config (e)
  3. Select the cmdline.txt tab and add the init=/bin/sh at the end as above
  4. Press OK and reboot
  5. When it stops, press Enter and where you see a line with #, type:reset password raspberry pi

You should be able to log in with the new password. Then do the process backward, to delete the init=/bin/sh line.

How to change the password after installing TightVNC server

Users sometimes encountered a login issue after installing a VNC server. The Pi boots, the user can log in via SSH, but then another login window pops up, where the Pi won’t accept the default credentials.

The tested solution is to go to the home directory, look for a file called .Xauthority and change the owner using the following command: chown pi:pi /home/pi/.Xauthority

What I should also pay attention to?modify password for raspberry noob

  1. Misspelling can oftentimes be the cause why the password gets rejected (like missing the in raspberry)
  2. Linux is case-sensitive and only small letters should be used
  3. If you’re not using a qwerty keyboard, pay attention to the letters
  4. When typed, the password it is not visible on the screen (only appears as *******), so typos are again possible

We hope you found this guide helpful. If you did, or if you have any suggestions, don’t hesitate to use the comment section below.


More about the topics: Raspberry Pi errors