How to Change the Raspberry Pi Default Password
Securing your Raspberry Pi by changing the default credentials is the
most critical first step in protecting your device from unauthorized
network access. This article provides a straightforward, step-by-step
guide on how to change the default password for the pi user
using both the terminal-based configuration tool and the command line
directly.
Method 1: Using the Raspberry Pi Configuration Tool
The easiest way to update your password, especially if you are using the desktop interface or prefer a menu-guided terminal experience, is through the built-in configuration utility.
- Open a terminal window on your Raspberry Pi, or connect via SSH.
- Launch the configuration tool by typing the following command and
pressing Enter:
sudo raspi-config - Use the arrow keys on your keyboard to navigate to System Options (or Localisation Options / Change User Password depending on your Raspberry Pi OS version) and press Enter.
- Select the Password option.
- Follow the on-screen prompts to type your new, secure password. Note that characters will not be displayed on the screen while you type for security reasons.
- Select Finish and exit the menu.
Method 2: Using the Command Line Directly
If you prefer a faster approach without navigating menus, you can update the password for the current user directly through the standard Linux command line.
- Open your terminal or establish an SSH connection to the device.
- Type the standard password modification command and press Enter:
passwd - You will be prompted to enter the Current password
(the default password for older OS versions is usually
raspberry). - Type your New password and press Enter.
- Retype new password to confirm the change and press Enter.
Security Note: Newer versions of Raspberry Pi OS (released after April 2022) no longer create a default
piuser with the passwordraspberryduring installation. Instead, they prompt you to create a custom username and password upon first boot. If you are running an older image, changing this default immediately is highly recommended.