When you first install Raspbian (the official Raspberry Pi Operating System), you will notice it comes with a default username “pi” and password “raspberry.” This user “pi” is a sudoer
– meaning he has overall access to the system and can even execute commands that require root privileges.
Changing the Raspberry Pi Password
For security reasons, it is therefore recommended you change this default password. In this post, we will look at two methods that you can use to perform this action.
- Using the
raspi-config
window - Using the
passwd
command
Method 1: Change password using raspi-config
I highly recommend this method to users who have access to their Raspberry Pi over SSH. However, you can still use it on the Raspberry Pi desktop user interface.
Follow the steps below:
Step 1: Execute the command sudo raspi-config
on the Raspberry terminal or the tool you are using for SSH access (e.g., Putty).
sudo raspi-config
That will open the Raspberry Pi Software Configuration Tool.
Step 2: Select the option “System options: Configure System Settings.”
Step 3: On the next screen, select “Password Change passwoord for pi user.”
Step 4: On the next screen, you will see a notification that you will be prompted to enter a new password.
On the Terminal window, you will see a prompt to type the new password. Type your new password.
Note: Linux system doesn’t show your password as you type. Not either by dots or Asterix. Therefore, type your password and hit Enter.
You will see a prompt to Retype your password for confirmation. Type the password again and hit Enter.
That’s it! You have successfully changed the password on your Raspberry Pi.
If you are running another distro other than Raspbian, you can use the second method below.
Method 2: Change password using the passwd command
Step 1: Launch the Terminal and run the command below:
sudo passwd
You will get a prompt to type your new password—hit Enter.
Note: Linux system doesn’t show your password as you type. Not either by dots or Asterix. Therefore, type your password and hit Enter.
You will be prompted to Retype the password. Once done, hit Enter.
That’s it! You have successfully changed the password on your Raspberry Pi.