As stupid as it sounds, here is the case:
tl;dr: ssh via wifi into Rpi works. ssh via usb works as well, but only when Rpi is connected to wifi. Why?
Imagine we have a Raspberry Pi Zero W working in headless mode running the latest Raspbian Stretch, up to date and all. Said Rpi has two modes of ssh manually established on it - USB (per instructions in
Video_1) and Wifi.
Here's the funky bit - ssh over USB seems to be wifi dependant. Meaning, it is possible to establish an ssh connection via a usb cable and work normally (
ssh firstname.lastname@example.org allows you to connect to the Rpi) when the pi is connected to wifi. Pull the plug on the router, and the USB connection is disabled - and you cannot work through it anymore.
What might be causing this? Is it possible to make sure that the two ssh connections - USB and Wifi - are independent? Could one even ssh into a Rpi via USB without the Rpi being connected any other network, such as on an airplane?
Board: Raspberry Pi Zero W, headless
OS: Raspbian Stretch with desktop, version April 2018
- Added a file named
dtoverlay=dwc2to the end of config.txt
modules-load=dwc2,g_etherto cmdline.txt after
- Added static IP assignments of gateway and Pi to the end of dhcpcd.conf
- Added network information (ssid, password) to wpa_supplicant.conf
Solved: The issue can be solved on Linux Ubuntu by changing the incoming Ethernet connection IPv4 parameters to Link-local-only