Raspberry Pi password not working? Try these solutions

Milan Stanojevic
by Milan Stanojevic
Deputy Editor
0 Comments
Download PDF
Affiliate Disclosure

  • 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.


FAQ: Read more about the RasperryPi password

  • What is the default password for Raspberry Pi?
The default username and password on Raspbian is pi; the default password is raspberry. Have a  look at our selection of the best Raspberry Pi emulators.
  • How do I find my Raspberry Pi username and password?

With Raspbian, the default username is pi, and the password is raspberry. You should change them after the first login, using the raspi-config tool, or the graphical Raspberry Pi Configuration tool.

  • How do I fix Raspberry Pi not connecting to the internet?

To fix the Raspberry issues regarding connecting to the internet, check out our comprehensive guide dealing with both ethernet and WiFi connections.