The default username is pi, but check what you actually have

Most Raspberry Pi systems ship with the username pi and the password raspberry. If you set up your Pi yourself and changed the username during installation, you need to know what you changed it to. If someone else set it up, or you inherited a Pi, the username might be anything.

The fastest way to find out is to look at what appears on the login screen itself. When you boot the Pi and reach the login prompt, it often shows the username field pre-filled or hints at what usernames exist on the system. If the screen shows "pi login:" then pi is the active user. If it shows a different name, that is your answer.

If you are already logged in and just need to confirm your own username, open a terminal and type whoami. The system prints your current username when ready. This works whether you are at the desktop or in command-line mode.

Key Takeaways

  • The default Raspberry Pi username is pi, but only if you did not change it during setup.
  • Type whoami in a terminal to see the username of the account you are currently using.
  • Type cat /etc/passwd to see a list of all user accounts on the system, though the output includes system accounts you cannot log in with.
  • If you are locked out completely, you may need to boot from a USB drive or SD card reader to access the filesystem and reset the password.
  • The login screen itself often shows or hints at valid usernames before you type anything.

List all user accounts on your Pi

If you need to see every username on the system, not just the one you are using, open a terminal and type cat /etc/passwd. This prints a file that contains one line per user account. Each line shows the username first, followed by colons and other information.

The output will include system accounts like root, bin, sys, and daemon — these are built-in accounts that run background services, not accounts you can log in with. Look for usernames that seem like real people: pi, admin, user, or custom names someone created. Real user accounts usually have a home directory path that includes /home/ in it.

For example, a line might read pi:x:1000:1000::/home/pi:/bin/bash. The first part before the colon is the username (pi). A line like root:x:0:0:root:/root:/bin/bash is the system administrator account, which you should not try to use unless you know what you are doing.

Check the home directory if you have file access

If you can access the Pi's filesystem through a file manager or USB card reader, navigate to the /home directory. Each user account on the system has a folder here with their username. If you see folders named /home/pi, /home/alice, and /home/admin, those are the usernames that exist.

This method works even if you cannot log in through the normal login screen. If your Pi is not booting or you forgot the password, you can remove the SD card, plug it into another computer using a USB card reader, and browse the /home folder directly. The usernames are the folder names you see there.

Reset a forgotten password if you know the username

If you know the username but forgot the password, you can reset it if you have physical access to the Pi. Boot into single-user mode or recovery mode by holding down Shift while the Pi starts up (on older Raspberry Pi OS versions) or by editing the boot configuration on another computer.

Once in recovery mode, you can use the passwd command to change the password for any user. Type passwd pi to reset the password for the pi user, or passwd username to reset it for any other account. The system prompts you to enter a new password twice.

If you cannot reach recovery mode, remove the SD card and plug it into another computer. Mount the filesystem, navigate to /etc, and edit the shadow file (which stores password hashes) or use other recovery tools. This is more technical and may require research specific to your operating system.

What to do if the Pi is completely inaccessible

If you cannot log in, do not know any username, and cannot access the filesystem from another computer, your options narrow. The most straightforward path is to reinstall Raspberry Pi OS from scratch using the Raspberry Pi Imager tool on another computer. This erases the old system and creates a fresh installation with the default username pi and password raspberry.

Before you do that, consider whether the Pi contains files you need to keep. If it does, try booting from a USB drive with a Linux live system (like Ubuntu or Debian) to mount the Pi's SD card and copy files off before reinstalling.

Reinstalling is not a failure — it is a standard recovery step when access is completely lost. You will have a working system again with a known username and password, and you can set up your accounts the way you want them.

Frequently Asked Questions

What is the default Raspberry Pi password?

The default password for the pi user is raspberry. If the system was set up by someone else or the password was changed, this will not work. Many people change the default password when ready for security reasons, so do not assume it is still raspberry.

Can I see usernames without logging in?

Yes, if you have physical access to the SD card. Remove it from the Pi, plug it into another computer using a USB card reader, and browse to the /home folder on the card. The folder names are the usernames. You can also read the /etc/passwd file the same way.

What if I see a lot of usernames I do not recognize?

Most of them are system accounts (root, bin, sys, daemon, etc.) that run background services. Look for usernames in /home — those are the real user accounts. System accounts usually do not have a /home directory and cannot be used to log in interactively.

Does whoami work if I am using SSH to connect?

Yes. Type whoami after you log in over SSH, and it shows the username of the account you connected with. This works the same way as typing it at the Pi's own keyboard.

Can I change my username after I log in?

Yes, but it is more involved than changing a password. You need to use the usermod command or create a new account and transfer files. If you just want to change the password, use passwd instead, which is much simpler.