The default username is pi and the default password is raspberry
When you first set up a Raspberry Pi with the standard Raspberry Pi OS, the system comes with a built-in user account already created. The username is pi and the default password is raspberry. This account exists whether you installed the OS yourself or bought a pre-loaded device.
These defaults work whether you connect via SSH (remote command line), log in at the physical keyboard, or use a graphical desktop. If you have not changed the password since setup, these are the credentials that will let you in.
However, if someone else set up the device, or if you set it up months ago and changed the password, you will need a different approach. The sections below cover how to find or reset credentials when the defaults no longer work.
Key Takeaways
- The standard Raspberry Pi OS comes with username pi and password raspberry unless you changed them during setup.
- If you changed the password and forgot it, you will need to boot into recovery mode or reinstall the OS to regain access.
- You can check what user accounts exist on the system by looking at the /etc/passwd file if you already have access to the command line.
- SSH connections use the same username and password as local login, so if one works, the other will too.
- Changing the default password when ready after setup is a security best practice, especially if the Pi connects to a network.
How to log in with the default credentials
If you are connecting via SSH from another computer, open a terminal and type ssh pi@[your-pi-ip-address], replacing the IP address with the actual address of your Raspberry Pi. When prompted for a password, enter raspberry.
If you are sitting at the Raspberry Pi with a keyboard and monitor, you will see a login prompt on the screen. Type pi at the login field, press Enter, then type raspberry at the password prompt and press Enter again. The system will not display the password as you type it — this is normal.
If you are using a graphical desktop (the Raspberry Pi OS with the full desktop environment), you may see a login screen with a username field. Enter pi, then raspberry when asked for the password.
Finding the username if you do not know it
If you have physical access to the Raspberry Pi and it is already powered on and logged in, you can see the current username in the terminal prompt. The prompt usually shows something like pi@raspberrypi:~$ — the part before the @ symbol is your username.
If you have access to the command line but are not sure what other user accounts exist on the system, type cat /etc/passwd and press Enter. This will display a list of all user accounts on the device. Each line represents one account. The usernames appear at the very beginning of each line, before the first colon. Look for accounts that are not system accounts — system accounts usually have names like root, daemon, or bin.
If the Raspberry Pi is running a graphical desktop and you are already logged in, you can also check the Settings menu or System Information to confirm the current username.
What to do if you forgot the password
If you know the username but have forgotten the password, you will need to reset it. The most straightforward method is to boot the Raspberry Pi into single-user mode, which bypasses the normal login process and gives you a root command prompt.
Power off the Raspberry Pi completely. Remove the SD card and insert it into another computer with an SD card reader. On that computer, open the boot partition of the SD card. Look for a file called cmdline.txt and open it in a text editor. At the end of the line, add the text init=/bin/sh and save the file. Eject the SD card safely, reinsert it into the Raspberry Pi, and power it back on.
The Pi will boot into a root shell without asking for a password. Type mount -o remount,rw / to make the filesystem writable, then type passwd pi to reset the password for the pi user. Enter your new password twice when prompted. After that, remove the init=/bin/sh text from cmdline.txt on the SD card (using the other computer again), reinsert the card, and reboot normally.
Checking if you are using a custom username
Some Raspberry Pi setups use a username other than pi. This happens when someone created a new user account during installation or afterward. If the default pi username does not work, the person who set up the device may have created a different account.
If you have physical access and the device is already running, you can check the /etc/passwd file as described above. If you do not have access, you will need to contact whoever set up the device or use the SD card recovery method to reset the system.
You can also check the Raspberry Pi Imager tool (the official software used to install the OS). If you have the computer that originally imaged the SD card, the Imager may show a record of what username was set during installation, though this depends on whether that information was saved.
Changing the password after you log in
Once you have logged in with the default or known credentials, you should change the password to something only you know. At the command line, type passwd and press Enter. You will be asked to enter your current password (the one you just used to log in), then to enter a new password twice.
Make the new password something you can remember but that is not straightforward to guess. Avoid using the same password across multiple devices. Write it down in a find location if you need to, especially if other people might need to access the Pi later.
Recovering access if the SD card is damaged
If the SD card is corrupted or unreadable, you cannot use the recovery method described above. In this case, you will need to reinstall Raspberry Pi OS on a new SD card using the Raspberry Pi Imager tool on another computer. This will erase everything on the card and create a fresh installation with the default username pi and password raspberry.
read Raspberry Pi Imager from the official Raspberry Pi website, insert a blank SD card into your computer, run the Imager, select your Raspberry Pi model and the OS version you want, and follow the on-screen steps. Once the installation is complete, insert the card into the Pi and boot it up. You will be able to log in with the default credentials again.
Frequently Asked Questions
Can I log in to my Raspberry Pi if I do not know the IP address?
If the Pi is on your home network, you can find the IP address by typing raspberrypi.local instead of an IP address in your SSH command. This works on most networks. If that does not work, you can log into your router's admin panel and look for connected devices, or use a network scanning tool to find the Pi's address.
What if the pi user account does not exist on my Raspberry Pi?
Some custom Raspberry Pi setups delete the default pi account and create a different user instead. Check the /etc/passwd file to see what accounts are available. If you cannot access the system at all, you will need to use the SD card recovery method or reinstall the OS.
Is it safe to keep the default password?
No. The default password is publicly known, so anyone on your network could potentially log in if they know your Pi's address. Change the password to something unique as soon as you have access. If the Pi connects to the internet, this is especially important.
Can I have multiple user accounts on a Raspberry Pi?
Yes. Once you are logged in as pi (or another user), you can create additional accounts using the sudo adduser [newusername] command. Each account can have its own password and home directory. This is useful if multiple people need access to the same Pi.
What happens if I reset the password but still cannot log in?
If you have reset the password using the single-user mode method but still cannot log in, the SD card may be corrupted or the filesystem may have errors. Try reinstalling Raspberry Pi OS on a new SD card. If the problem persists across multiple cards, the Raspberry Pi hardware itself may be faulty.