Changing a user password on a Raspberry Pi is a straightforward process that can be done securely by following these steps. Whether you’re using it as a desktop, a headless server, or part of a project, maintaining strong passwords is crucial for keeping your Raspberry Pi secure.
Change the Password
Update your system first
sudo apt update && sudo apt upgrade -y
To change a user’s password, use the passwd
command. Here’s how:
For your own user account:
passwd
To change the password for another user (requires sudo
privileges):
sudo passwd username
Replace username
with the name of the user whose password you want to change.
Enter and Confirm the New Password
Use a Strong Password Create a password that is at least 12 characters long and includes uppercase letters, lowercase letters, numbers, and symbols.
You’ll be prompted to:
- Enter the current password
- Enter the new password
- Re-enter (confirm) it for confirmation
For security reasons, the password won’t appear as you type. If the two entries match, the new password will be set.