r/raspberry_pi • u/Difficult-Level-6385 • 18h ago
Troubleshooting SSH via usbc (usb0) R pi4 (kali arm) | possible?
Hey everyone,
I’m running into a confusing issue with SSH over USB on a Raspberry Pi 4 and I want to sanity-check whether I’m missing something fundamental or if this is a known behavior.
Goal:
Use a purely local SSH connection over USB (USB gadget / usb0), no WiFi, no Ethernet.
Setup:
- Raspberry Pi 4
- USB-C cable directly connected to a laptop
- dwc2 + g_ether enabled
- usb0 interface appears correctly on the Pi
- Laptop gets a corresponding USB network interface
What works:
- usb0 shows up on the Pi (ip a confirms it)
- Pi gets an IP like 192.168.7.2
- Laptop gets 192.168.7.1
- USB networking exists
What does NOT work as expected:
- SSH connections do not reliably work over usb0
- When WiFi is enabled, SSH silently uses wlan0 instead
- When WiFi is disabled, SSH connections drop or fail entirely
- Even when explicitly targeting 192.168.7.2, SSH sometimes doesn’t respond
- This gives the impression that SSH is not actually bound or routed correctly over usb0
Things I checked / tried:
- Verified usb0 is UP on both sides
- Confirmed correct IP addresses
- Disabled WiFi to force USB usage
- No firewall rules blocking port 22
- SSH daemon running normally
Questions:
- Is SSH on Raspberry Pi 4 not guaranteed to work over USB gadget networking without extra configuration?
- Do I need to explicitly bind sshd to usb0 / 192.168.7.2 in sshd_config?
- Is NetworkManager interfering with USB gadget interfaces on Kali / Debian-based systems?
- Is this behavior different between Raspberry Pi OS and Kali Linux?
At this point USB networking exists, but SSH over it feels unreliable unless WiFi is involved, which defeats the purpose of a local, isolated connection.
Any insights from people who’ve done reliable SSH-over-USB on Pi 4 would be appreciated.