# Forum Post: Pi Zero 2W SSH Connection Issue
**Subject:** Couldn't SSH into Pi Zero 2W for Pi-hole setup
---
**Problem Summary:**
Unable to connect to Raspberry Pi Zero 2W via SSH despite multiple configuration attempts. Pi connects to WiFi successfully but SSH port remains closed/filtered.
**Hardware:**
- Raspberry Pi Zero 2W
- 32GB SD card
- Mercusys router (2.4GHz WiFi)
- Windows 11 PC with WSL
**Software:**
- Raspberry Pi OS Lite (32-bit) - Latest version
- Raspberry Pi Imager for flashing V-2.0.3
**Network Status:**
- Pi appears in router as "mspihole" at 192.168.0.103
- Static IP reserved via DHCP
- Ping shows "Destination host unreachable"
- nmap shows port 22 as "filtered"
**What I've Tried:**
**Attempt 1: Manual SSH File Creation**
- Inserted SD card after flashing
- Attempted to create empty "ssh" file in boot partition
- Tried multiple methods:
- Windows File Explorer (suspected saved as ssh.txt)
- PowerShell: `New-Item -Path "ssh" -ItemType File`
- PowerShell: `echo. > ssh`
- Command Prompt: `type nul > ssh`
- File either wouldn't save or wasn't recognized by Pi
**Attempt 2: USB Gadget Mode Configuration**
Modified config files on boot partition:
config.txt - Added at end:
```
dtoverlay=dwc2
```
cmdline.txt - Added after rootwait (single line):
```
modules-load=dwc2,g_ether
```
- Connected micro USB to DATA port (middle port)
- USB Ethernet adapter didn't appear in Device Manager
- No network connection established
**Attempt 3: Raspberry Pi Imager with SSH Pre-enabled**
- Used Ctrl+Shift+X to access advanced options
- Configured before writing:
-
Hostname: mspihole
-
Enable SSH (password authentication)
-
Username: piuser / Password: [set]
-
WiFi SSID and password (verified correct)
-
WiFi country: IN
-
Locale: Asia/Kolkata
- Flashed successfully
- Pi connected to WiFi (confirmed in router)
- SSH still times out
**Connection Attempts:**
```bash
# All failed with "Connection timed out"
ssh piuser@192.168.0.103
ssh piuser@mspihole.local
ssh piuser@mspihole
# nmap results
nmap -Pn -p 22 192.168.0.103
PORT STATE SERVICE
22/tcp filtered ssh
```
**Current Status:**
- Pi boots successfully (green LED activity normal)
- WiFi connection established (shows in router)
- No network traffic (0 B/s upstream/downstream)
- SSH port completely inaccessible
- No monitor/keyboard available for direct access
**Questions:**
1. Why would Raspberry Pi Imager's SSH setting not apply despite successful WiFi configuration?
2. Is there a known bug with Pi Zero 2W and SSH auto-enable?
3. Could the SD card or specific hardware be blocking the ssh file from being read?
4. Any other remote access methods to enable SSH without physical access?
**Additional Notes:**
- Tried on multiple fresh SD card images
- Router has no firewall rules blocking port 22
- Other devices can SSH to each other on same network
- This is for a Pi-hole ad-blocking DNS server setup
Any help would be greatly appreciated!
**Subject:** Couldn't SSH into Pi Zero 2W for Pi-hole setup
---
**Problem Summary:**
Unable to connect to Raspberry Pi Zero 2W via SSH despite multiple configuration attempts. Pi connects to WiFi successfully but SSH port remains closed/filtered.
**Hardware:**
- Raspberry Pi Zero 2W
- 32GB SD card
- Mercusys router (2.4GHz WiFi)
- Windows 11 PC with WSL
**Software:**
- Raspberry Pi OS Lite (32-bit) - Latest version
- Raspberry Pi Imager for flashing V-2.0.3
**Network Status:**
- Pi appears in router as "mspihole" at 192.168.0.103
- Static IP reserved via DHCP
- Ping shows "Destination host unreachable"
- nmap shows port 22 as "filtered"
**What I've Tried:**
**Attempt 1: Manual SSH File Creation**
- Inserted SD card after flashing
- Attempted to create empty "ssh" file in boot partition
- Tried multiple methods:
- Windows File Explorer (suspected saved as ssh.txt)
- PowerShell: `New-Item -Path "ssh" -ItemType File`
- PowerShell: `echo. > ssh`
- Command Prompt: `type nul > ssh`
- File either wouldn't save or wasn't recognized by Pi
**Attempt 2: USB Gadget Mode Configuration**
Modified config files on boot partition:
config.txt - Added at end:
```
dtoverlay=dwc2
```
cmdline.txt - Added after rootwait (single line):
```
modules-load=dwc2,g_ether
```
- Connected micro USB to DATA port (middle port)
- USB Ethernet adapter didn't appear in Device Manager
- No network connection established
**Attempt 3: Raspberry Pi Imager with SSH Pre-enabled**
- Used Ctrl+Shift+X to access advanced options
- Configured before writing:
-
-
-
-
-
-
- Flashed successfully
- Pi connected to WiFi (confirmed in router)
- SSH still times out
**Connection Attempts:**
```bash
# All failed with "Connection timed out"
ssh piuser@192.168.0.103
ssh piuser@mspihole.local
ssh piuser@mspihole
# nmap results
nmap -Pn -p 22 192.168.0.103
PORT STATE SERVICE
22/tcp filtered ssh
```
**Current Status:**
- Pi boots successfully (green LED activity normal)
- WiFi connection established (shows in router)
- No network traffic (0 B/s upstream/downstream)
- SSH port completely inaccessible
- No monitor/keyboard available for direct access
**Questions:**
1. Why would Raspberry Pi Imager's SSH setting not apply despite successful WiFi configuration?
2. Is there a known bug with Pi Zero 2W and SSH auto-enable?
3. Could the SD card or specific hardware be blocking the ssh file from being read?
4. Any other remote access methods to enable SSH without physical access?
**Additional Notes:**
- Tried on multiple fresh SD card images
- Router has no firewall rules blocking port 22
- Other devices can SSH to each other on same network
- This is for a Pi-hole ad-blocking DNS server setup
Any help would be greatly appreciated!
Statistics: Posted by manikandan_ms — Sat Dec 27, 2025 11:08 am — Replies 9 — Views 83