If you canât log in to your Raspberry Pi (no monitor, no keyboard, SSH disabled), the fastest and most reliable way to enable SSH is by placing an empty file named ssh in the boot partition of the SD card.
This works on any Raspberry Pi OS, including headless setups.
â Steps
1. Power off the Raspberry Pi
Unplug the power only after the green ACT LED stops blinking.
2. Insert the microSD card into your PC
On Windows, only the boot partition will be visible.
3. Open the boot partition
You should see files such as:
- config.txt
- cmdline.txt
- kernel.img
4. Create an empty file named ssh
Place it in the root of the boot partition.
Requirements:
- Filename:
ssh - No extension
- No contents
- Lowercase recommended
Windows steps:
- Rightâclick â New â Text Document
- Rename the file to:
ssh
When Windows warns you about removing .txt, click Yes.
5. Eject the SD card and insert it back into the Raspberry Pi
6. Boot the Raspberry Pi
On first boot, Raspberry Pi OS will:
- Detect the
sshfile - Enable the SSH service
- Delete the
sshfile automatically - Start listening on port 22
Now you can connect via SSH:
ssh username@<raspberry-pi-ip>