I'm using Raspbian Buster and I'm using my Raspberry Pi headlessly. After I log in to SSH when I use a new OS image, I always change the password from the default one. I use sudo passwd to change the password. Now, when I change my password, everything works successfully but the password doesn't really change, so I have to use raspbian when I SSH in next time, even when I've changed the password to something else. How do I change my password so it's recognised?

  • 3
    How exactly do you change the password?
    – Dirk
    Commented Mar 25, 2020 at 16:20
  • It possible that the SD card is failing - how old is the card?
    – user115418
    Commented Mar 25, 2020 at 16:27
  • @Dirk I use sudo passwd to change the password.
    – SkyPlayX
    Commented Mar 26, 2020 at 5:46
  • @Andyroo The card is three months old.
    – SkyPlayX
    Commented Mar 26, 2020 at 5:47

1 Answer 1


If you typed sudo passwd without any other arguments, you changed the password of the root user. If you want to change the password of a regular user (for example pi), there are two easy ways to do it:

  1. Log in as the user and run passwd without sudo.
  2. Run sudo passwd pi to change pi's password. You can replace pi with any username that exists on your system. I recommend that you use the first option if you're not familiar with the passwd command.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.