2

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 Mar 25 at 16:20
  • It possible that the SD card is failing - how old is the card? – Andyroo Mar 25 at 16:27
  • @Dirk I use sudo passwd to change the password. – SkyPlayX Mar 26 at 5:46
  • @Andyroo The card is three months old. – SkyPlayX Mar 26 at 5:47
3

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.
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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