In this post, we’ll cover the default login credentials, how to change the password, and why doing so is critical for security.
🔐 Default Username and Password
For Raspberry Pi OS (formerly Raspbian), the default credentials are:
- Username:
pi
- Password:
raspberry
These are used for both local login and remote access via SSH (if enabled).
⚠️ Why You Should Change the Default Password
Leaving the default password unchanged is a major security risk—especially if your Pi is connected to the internet or accessible via SSH. Anyone who knows the default credentials could potentially access your system.
🔄 How to Change the Password
To change the password for the current user (usually pi
):
passwd
You’ll be prompted to enter the current password, then choose a new one.
⚙️ Change Password via Raspberry Pi Configuration Tool
You can also use the built-in configuration tool:
sudo raspi-config
Navigate to:
System Options → Password
Follow the prompts to set a new password.
🧠 Tip: Create a New User (Optional)
For better security, consider disabling the default pi
user and creating your own user account:
sudo adduser yourname
sudo usermod -aG sudo yourname
Then disable the pi
account if you no longer need it:
sudo usermod -L pi
💬 What if You Forgot the Password?
If you’ve changed the password and forgot it, you can reset it by:
- Booting into recovery mode from the SD card
- Mounting the root filesystem and editing
/etc/shadow
or usingpasswd
from chroot
Or re-flashing the Raspberry Pi OS image as a last resort.