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?
1 Answer
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:
- Log in as the user and run
passwd
without sudo. - Run
sudo passwd pi
to change pi's password. You can replacepi
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.
sudo passwd
to change the password.