If you’ve ever worked with a headless Raspberry Pi, you’ve probably faced this problem:
The Raspberry Pi was previously connected to a Wi-Fi network
You do not know which network it is connected to
You cannot connect a monitor, keyboard, or mouse
SSH is your only option
The Pi is no longer appearing on your current network
This usually happens when:
You move to a new location
Your Wi-Fi name/password changes
Someone else configured the Pi
You forgot the old network credentials
In this guide, I’ll show you how to:
Diagnose the problem
Reconfigure Wi-Fi without a monitor
Force the Pi onto a new network
Recover SSH access
The methods below work for:
Raspberry Pi 3
Raspberry Pi 4
Raspberry Pi 5
Raspberry Pi Zero W/2W
Understanding the Problem
A Raspberry Pi configured for headless access boots and automatically tries to connect to the Wi-Fi credentials saved inside:
wpa_supplicant.conf
Enter fullscreen mode
Exit fullscreen mode
If:
the saved Wi-Fi no longer exists
the password…