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.

  1. Open a terminal window on your Raspberry Pi, or connect via SSH.
  2. Launch the configuration tool by typing the following command and pressing Enter: sudo raspi-config
  3. 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.
  4. Select the Password option.
  5. 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.
  6. 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.

  1. Open your terminal or establish an SSH connection to the device.
  2. Type the standard password modification command and press Enter: passwd
  3. You will be prompted to enter the Current password (the default password for older OS versions is usually raspberry).
  4. Type your New password and press Enter.
  5. 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 pi user with the password raspberry during 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.