The default username and password on a fresh Raspberry Pi
When you first set up a Raspberry Pi with the official Raspberry Pi OS, the system comes with a built-in user account. The default username is pi and the default password is raspberry. These credentials work whether you are connecting over SSH (a remote terminal connection), logging in at the physical keyboard, or accessing the desktop environment.
However, the Raspberry Pi Foundation changed this setup starting with Raspberry Pi OS Bookworm (released in October 2023). Newer versions no longer have a default password at all — instead, you set your own username and password during the initial setup wizard when you first boot the device. If you installed Bookworm or later, you will not find a universal default; you will need to use whatever credentials you created during that setup.
If you cannot remember the password you set during setup, or if you are working with an older installation, the sections below show you how to recover or reset it.
Key Takeaways
- Raspberry Pi OS versions before Bookworm use the default username pi and password raspberry, but this only works if the password has never been changed.
- Raspberry Pi OS Bookworm and newer require you to create your own username and password during first boot, so there is no universal default to try.
- If you have physical access to the Raspberry Pi, you can reset a forgotten password by booting into single-user mode and changing it directly.
- If you are connecting remotely and do not know the password, you will need physical access to the device to regain entry.
- The username is almost always pi on older systems, but on Bookworm and later it is whatever you chose during setup.
How to check which Raspberry Pi OS version you have
Before you try the default credentials, it helps to know which version of Raspberry Pi OS is installed. You can find this by looking at the system information on the device itself, or by checking the SD card on another computer.
If you have the Raspberry Pi powered on and can see the desktop, open a terminal (right-click the desktop and select Terminal, or press Ctrl+Alt+T). Type cat /etc/os-release and press Enter. Look for the line that says VERSION_CODENAME. If it says bookworm, trixie, or fortnightly, you have a newer version with no default password. If it says bullseye, buster, or stretch, the default credentials should work.
If the Raspberry Pi is not powered on, you can insert the SD card into another computer and look at the files. Navigate to the root of the SD card and open the file called os-release in a text editor. The VERSION_CODENAME line will tell you which version is installed.
Resetting a forgotten password on older Raspberry Pi OS versions
If you have physical access to the Raspberry Pi and you have forgotten the password for the pi user (or any other user), you can reset it by booting into single-user mode. This bypasses the normal login and gives you root access to change the password.
Power on the Raspberry Pi and wait for it to start booting. As soon as you see text appearing on the screen, press and hold the Shift key. Keep holding it until you see a menu with boot options. Select the option that says "1 Edit cmdline.txt" or similar. At the end of the line, add a space and then type init=/bin/sh. Save the file (usually Ctrl+X, then Y, then Enter) and let the system continue booting.
The system will boot into a root shell prompt. Type mount -o remount,rw / to make the filesystem writable, then press Enter. Now type passwd pi (or passwd followed by the username you want to reset). You will be prompted to enter a new password twice. Type your new password and press Enter each time. Once the password is changed, type exit to reboot the system normally.
When the system comes back up, you can log in with the username pi and your new password.
Finding the username if you only know the password
If someone gave you a Raspberry Pi with a password but did not tell you the username, you can find it by looking at the system files. This requires either physical access to the SD card or the ability to log in remotely as any user.
If you have the SD card, insert it into another computer and navigate to the home folder on the card. The usernames are the names of the folders inside — typically you will see a folder called pi on older systems. On Bookworm systems, you will see whatever username was created during setup.
If you can log in remotely but do not know the username, try pi first (the most common default). If that does not work, you can sometimes see a list of users by looking at the /etc/passwd file, but this usually requires already being logged in.
Connecting to your Raspberry Pi remotely with SSH
Once you know your username and password, you can connect to the Raspberry Pi from another computer using SSH. On Windows, you can use PuTTY or the built-in SSH client in PowerShell. On Mac or Linux, open a terminal and type ssh pi@192.168.1.100 (replace 192.168.1.100 with your Raspberry Pi's actual IP address). Press Enter and you will be prompted for the password.
If you do not know the IP address of your Raspberry Pi, you can find it by looking at your router's connected devices list, or by using a network scanning tool like Angry IP Scanner. Once you have the IP address, the SSH command will connect you to a terminal on the Raspberry Pi where you can run commands as if you were sitting at the keyboard.
What to do if you have a Bookworm system and forgot your password
If you set up a Raspberry Pi with Bookworm or later and have now forgotten the password you created, the recovery process is the same as for older versions: you need physical access to the device and the ability to boot into single-user mode. Follow the steps in the "Resetting a forgotten password" section above, but use your actual username instead of pi.
If you do not have physical access to the Raspberry Pi, there is no way to recover the password remotely. You will need to either contact whoever has physical access to the device, or reinstall the operating system on the SD card (which will erase all data on the card).
Changing your password after you log in
Once you have logged in with your current password, you can change it to something new. At the terminal, type passwd and press Enter. You will be asked to enter your current password, then your new password twice. The system will confirm the change.
If you are an administrator and want to change another user's password, type passwd username (where username is the account you want to change). You will not be asked for that user's current password — only for the new password twice.
Frequently Asked Questions
Will the default username and password work on my Raspberry Pi?
Only if you have Raspberry Pi OS Bullseye or earlier and have never changed the password. Try username pi and password raspberry. If you have Bookworm or later, there is no default — you set your own during setup.
Can I reset the password without physical access to the Raspberry Pi?
No. Password resets require either booting into single-user mode (which needs a keyboard and monitor) or reinstalling the operating system. If the Raspberry Pi is remote and you have lost the password, you will need someone with physical access to help.
What if I do not know the IP address to connect via SSH?
Check your router's list of connected devices — most routers have a web interface where you can see all devices on the network. You can also use a network scanner like Angry IP Scanner or Nmap to find all active devices on your network and identify the Raspberry Pi by its hostname.
Is it safe to use the default password?
No. If your Raspberry Pi is connected to the internet or a shared network, anyone who knows the default credentials can log in. Change the password when ready after first setup, especially if the device is exposed to untrusted networks.
Can I have multiple user accounts on a Raspberry Pi?
Yes. Once you are logged in, you can create new user accounts using the adduser command in the terminal. Each user can have their own password and home directory. This is useful if multiple people need access to the same Raspberry Pi.