UK tech experts · info@vividrepairs.co.uk
Vivid Repairs
Raspberry Pi Zero WH on a wooden desk next to a laptop showing an SSH terminal with permission denied error message
Fix It Yourself · Troubleshooting

Pi Zero SSH password rejected

Updated 8 August 202611 min read
As an Amazon Associate, we may earn from qualifying purchases. Our ranking is independent.

Pi Zero SSH password rejected on a brand-new Bookworm Lite install is one of the most common headless setup problems we see right now. The Pi responds to ping, SSH connects, and then every single password attempt comes back as Permission denied. If that's exactly what you're looking at, you're in the right place.

TL;DR

Pi Zero SSH password rejected on Bookworm Lite almost always means the default 'pi' user no longer exists, your Imager credentials didn't save properly, or your Windows SSH client is trying keys instead of a password. Force password-only auth first, then re-image with explicit credentials if that fails.

⏳ 13 min read ✅ 85% success rate 📅 Updated July 2026

Key Takeaways

  • Pi Zero SSH password rejected on Bookworm is almost never a hardware fault. It's a credentials or setup problem.
  • The default 'pi' user and 'raspberry' password are gone in Bookworm. Full stop.
  • Raspberry Pi Imager customisations sometimes fail to persist on Bookworm Lite headless setups.
  • Windows SSH clients can silently try key-based auth and reject your password before you even type it.
  • Most cases fix in under 15 minutes. The chroot repair is a last resort and takes around 30 minutes.

At a Glance

  • Difficulty: Easy to Medium
  • Time Required: 15 to 30 mins
  • Success Rate: 85% of users fixed with re-image or SSH flag

What Causes Pi Zero SSH Password Rejected on Bookworm?

The single biggest reason people hit Pi Zero SSH password rejected after a fresh Bookworm Lite install is simple: they're trying to log in as 'pi' with the password 'raspberry'. That combination hasn't worked since Raspberry Pi OS moved to Bookworm. The legacy default user was removed as a security measure, and there is no fallback. If you didn't explicitly create a user during imaging, there is no user to log in as. The Pi isn't broken. It's doing exactly what it's supposed to do.

But that's not the only cause. Here are the ones we see regularly:

  • Imager customisations didn't persist. This is genuinely common on Bookworm Lite. You fill in the hostname, username, password, and tick 'Enable SSH' in the advanced settings, hit Write, and assume it worked. Sometimes it doesn't. The firstrun.sh or userconf.txt file that Imager writes to the boot partition either doesn't get created or gets ignored during first boot. You end up with a Pi that has SSH listening but no user account to authenticate against.
  • First boot isn't finished. A Pi Zero is slow. Not a little slow. On a Bookworm Lite image, first-boot provisioning can take 5 to 10 minutes, and during that window SSH may accept connections but reject every login attempt. Plenty of people give up after 90 seconds and assume something is broken.
  • Windows SSH client is using keys instead of passwords. If you've ever used SSH keys on your Windows machine, your client may be trying to authenticate with a key that the Pi doesn't have. The failure looks identical to a wrong password. This one catches people out constantly.
  • Stale known_hosts or SSH config entries. Re-imaged the card? The Pi's host key changed. Windows might be blocking the connection silently, or a per-host config entry in ~/.ssh/config is forcing a different username or auth method than you intend.
  • Wrong device or image selected in Imager. Selecting the wrong OS profile means the customisation layer applies to a different image than what actually boots. The result is a Pi that boots fine but has none of your settings.

Understanding which of these you're dealing with matters, because the fix is different for each one. Work through the solutions below in order. Most people are sorted by the end of the Quick Fix section.

Pi Zero SSH Password Rejected: Quick Fixes

These first two fixes take under 10 minutes and fix the majority of cases. Try them before anything else.
1

Wait for First Boot to Complete Easy

  1. Power on the Pi Zero and leave it alone.
    Plug it in and walk away for at least 8 minutes. Set a timer if you need to. The Pi Zero has a single-core 1GHz processor with no hardware floating-point, and Bookworm Lite runs a fair amount of first-boot provisioning including SSH key generation, filesystem expansion, and user account creation. Trying to SSH in during this window is what causes Pi Zero SSH password rejected errors that mysteriously disappear later.
  2. Retry SSH after the wait.
    Open PowerShell or Terminal and run: ssh youruser@raspberrypi.local (replace youruser with whatever you set in Imager). If it prompts for a password and accepts it, you're done.
If login succeeds, first boot just needed more time. No further action needed.
2

Force Password Authentication on Windows Easy

  1. Open PowerShell or Command Prompt.
    Don't use PuTTY or any saved session for this test. Run the following command exactly, substituting your actual username:
    ssh -o PreferredAuthentications=password -o PubkeyAuthentication=no youruser@raspberrypi.local
    This tells the SSH client to ignore any keys it has stored and go straight to password authentication. If Pi Zero SSH password rejected was being caused by key confusion, this fixes it immediately.
  2. Check your ~/.ssh/config file.
    Open C:\Users\YourName\.ssh\config in Notepad. Look for any block starting with Host raspberrypi.local or Host raspberrypi. If you find one, it may be forcing a different username, a specific key file, or a non-password auth method. Either delete that block or temporarily rename the whole config file to config.bak and retry.
  3. Clear the stale host key if needed.
    If you re-imaged the card, the Pi's SSH host key changed. Windows will either block the connection or warn you. Open C:\Users\YourName\.ssh\known_hosts and delete the line containing raspberrypi.local, then retry.
If login works after forcing password auth, your SSH config was the culprit. Keep the -o flags or clean up the config file permanently.

More Pi Zero SSH Password Rejected Solutions

If the quick fixes above didn't sort it, the most likely remaining cause is that your Imager customisations simply didn't make it onto the card. This is a known issue with Bookworm Lite headless setups. Re-imaging properly fixes it in the vast majority of remaining cases. See the Raspberry Pi headless setup guide for more background on how the Imager customisation flow works.

3

Re-Image with Correct Imager Settings Easy

  1. Download the latest Raspberry Pi Imager.
    Get it from raspberrypi.com/software. Don't use an old version. Imager has had several fixes to the headless customisation flow and older versions have known reliability problems with Bookworm.
  2. Select the correct device and OS.
    In Imager, choose Raspberry Pi Zero as the device, then select Raspberry Pi OS Lite (32-bit) under the Raspberry Pi OS (other) submenu. Getting the device selection right matters because Imager uses it to determine which customisation profile to apply.
  3. Open advanced settings before writing.
    Click the gear icon (or press Ctrl+Shift+X). You'll see fields for hostname, username, password, SSH, and Wi-Fi. Fill in all of them. Use a username that is NOT 'pi'. Set a password you'll remember. Tick 'Enable SSH' and select 'Use password authentication'. Do not skip this step and assume defaults will work. They won't.
  4. Write the card and verify.
    Click Write. When it finishes, Imager will verify the card. Let it complete. After verification, safely eject the card, insert it into the Pi Zero, and power on. Wait the full 8 to 10 minutes before attempting SSH.
After re-imaging with correct settings, Pi Zero SSH password rejected should be gone. Log in with the exact username and password you set in Imager.
Do not try to use 'pi' as your new username even when creating a fresh account. Some Bookworm versions handle it oddly. Pick something else.
4

Inspect the SD Card for Missing User Accounts Medium

  1. Mount the SD card on another machine.
    On Windows, use a tool like DiskGenius or WSL2 to access the ext4 root partition. On Linux or Mac, just mount it directly. The boot partition (FAT32) is readable on Windows natively, but the root partition (ext4) needs a driver or WSL2.
  2. Check /etc/passwd for user accounts.
    Open the file at /etc/passwd on the root partition. Each line is one account. Look for any entry with a UID of 1000 or above, which indicates a real user rather than a system account. A typical entry looks like: youruser:x:1000:1000:,,,:/home/youruser:/bin/bash. If no such entry exists, the Imager customisation did not apply and you need to re-image as described in Solution 3.
  3. Check the boot partition for provisioning files.
    On the FAT32 boot partition, look for files named firstrun.sh or userconf.txt. If neither file exists, Imager did not write the customisation data. That confirms the re-image path. If firstrun.sh is present but the Pi has already booted, it may have been consumed and deleted, which is normal behaviour.
If you find a valid user in /etc/passwd, the account exists and the problem is likely the SSH client or a wrong password. If no user exists, re-image.

Advanced Pi Zero SSH Password Rejected Fixes

These are for situations where re-imaging isn't practical, or where you need to repair a card that's otherwise working fine. The chroot method in particular is useful if you've got data on the card you don't want to lose, or if you're trying to understand exactly what went wrong. For similar SSH troubleshooting on other Linux-based devices, the Linux SSH connection refused guide covers some overlapping territory worth reading.

5

Chroot Repair of User Account on Linux Advanced

  1. Mount the SD card root partition.
    On a Linux machine, insert the SD card and identify the root partition with lsblk. It'll typically be something like /dev/sdb2. Mount it: sudo mount /dev/sdb2 /mnt/pi.
  2. Bind the required virtual filesystems.
    Run these four commands:
    sudo mount --bind /dev /mnt/pi/dev
    sudo mount --bind /proc /mnt/pi/proc
    sudo mount --bind /sys /mnt/pi/sys
    sudo mount --bind /dev/pts /mnt/pi/dev/pts
    These are needed so tools inside the chroot can function properly.
  3. Chroot into the Pi filesystem.
    Run: sudo chroot /mnt/pi /bin/bash. You're now operating as if you're inside the Pi's OS. The prompt will change.
  4. Create or repair the user account.
    To create a new user: useradd -m -s /bin/bash youruser then passwd youruser and enter a new password twice. To just reset a password for an existing user: passwd youruser. To add the user to the sudo group: usermod -aG sudo youruser.
  5. Exit and unmount cleanly.
    Type exit to leave the chroot. Then unmount in reverse order:
    sudo umount /mnt/pi/dev/pts
    sudo umount /mnt/pi/sys
    sudo umount /mnt/pi/proc
    sudo umount /mnt/pi/dev
    sudo umount /mnt/pi
    Eject the card safely before removing it.
Boot the Pi Zero with the repaired card. SSH in using the username and password you just set. Pi Zero SSH password rejected should now be gone.
6

Enable SSH Manually via Keyboard and Monitor Medium

  1. Connect a micro-HDMI adapter and USB keyboard.
    The Pi Zero WH has a mini-HDMI port. You'll need a mini-HDMI to HDMI adapter, a standard HDMI cable, and a USB keyboard connected via the USB OTG port (the one labelled USB, not PWR). Boot the Pi and watch the display. You should see the Bookworm desktop or console login prompt once first boot completes.
  2. Log in locally and check SSH status.
    Log in with the credentials you set in Imager (or if none were set, you'll need to create a user first via the console). Once logged in, run: sudo systemctl status ssh. On some Bookworm Lite installs, SSH is present but not running. If the status shows 'dead' or 'inactive', that's your problem.
  3. Enable and start SSH.
    Run: sudo systemctl enable --now ssh. Verify it's running with sudo systemctl status ssh. You should see 'active (running)'. From this point, SSH over the network should work with the credentials you used to log in locally. This approach is also covered in the Raspberry Pi SSH not working guide for broader context.
Once SSH is active and you've confirmed your credentials locally, Pi Zero SSH password rejected over the network should be resolved.
Microsoft's OpenSSH documentation at learn.microsoft.com has good detail on how Windows handles SSH authentication preferences, which is useful if you're still seeing client-side issues after fixing the Pi itself.

Preventing Pi Zero SSH Password Rejected in Future

Most of these problems are avoidable. Here's what actually makes a difference, in order of importance.

1. Set credentials in Imager every single time, without exception. Don't assume defaults. Don't reuse a card without re-imaging. Every time you write a Bookworm Lite image, open the advanced settings, set a hostname, a real username (not 'pi'), a password, and tick SSH enabled. Takes 90 seconds and prevents 80% of the problems in this guide.

2. Wait the full 8 to 10 minutes on first boot. Seriously. The Pi Zero is not fast. Set a timer, make a coffee, come back. Attempting SSH during provisioning is one of the most common causes of Pi Zero SSH password rejected reports we see, and it's entirely avoidable.

3. Write down the credentials you used. This sounds obvious but people re-image cards regularly and forget what they typed. A sticky note on the Pi, a note in your password manager, anything. When Pi Zero SSH password rejected appears, the first question is always 'are you sure that's the right username?' and the answer is often 'well, I think so'.

4. Test with explicit password-only SSH flags the first time you connect. Using ssh -o PreferredAuthentications=password -o PubkeyAuthentication=no youruser@raspberrypi.local as your first connection attempt rules out Windows SSH client issues from the start. Once you've confirmed it works, you can set up keys properly if you want them.

5. Keep Raspberry Pi Imager updated. The official Raspberry Pi documentation notes that headless customisation reliability has improved across Imager versions. Running an old version is a known risk factor for exactly this kind of problem.

Pi Zero SSH Password Rejected: Summary

Pi Zero SSH password rejected on Bookworm Lite is almost always one of three things: you're using the old pi/raspberry credentials that no longer exist, your Imager customisations didn't persist to the card, or your Windows SSH client is trying keys instead of a password. Work through the solutions in order. Force password-only auth first (takes two minutes), then re-image with proper settings if that doesn't fix it. The chroot repair and keyboard/monitor methods are there for edge cases but most people won't need them. Get the credentials right in Imager, wait for first boot to finish, and Pi Zero SSH password rejected becomes a problem you don't see twice.

Frequently Asked Questions

Bookworm removed the default pi user entirely. You must create a new username and password explicitly in Raspberry Pi Imager before writing the image. The old pi/raspberry credentials no longer work on any fresh Bookworm install.

Bookworm Lite headless customisations sometimes fail to persist to the SD card. Re-image, open the advanced settings gear icon in Imager, and confirm SSH, hostname, username, and password are all saved before you click Write. Then wait at least 5 to 10 minutes after first boot before testing.

Run: ssh -o PreferredAuthentications=password -o PubkeyAuthentication=no youruser@raspberrypi.local. Also check C:\Users\YourName\.ssh\config for any per-host entries that might be overriding your intended method and rename or delete that file temporarily.

Yes. If you have a Linux machine or Windows with WSL2, mount the SD card, chroot into the root filesystem, and use passwd or useradd to repair the account. Alternatively, attach a keyboard and HDMI monitor to the Pi Zero, complete first-boot setup locally, then enable SSH manually with sudo systemctl enable --now ssh.

Mount the SD card on another machine and open the file /etc/passwd on the root (ext4) partition. Each line represents a user account. Look for any entry that is not a system account (UID 1000 or above is typically a real user). If no such entry exists, the Imager customisation did not apply and you need to re-image.