If you don’t want to connect a screen, keyboard nor network card to a Raspberry Pi Zero, we need to setup a headless OTG configuration which allows us to SSH to the Pi over the USB interface (and the USB interface only). This little GitHub Gist shows what we need to do:

  1. add dtoverlay=dwc2 to config.txt
  2. add modules-load=dwc2,g_ether after rootwait in cmdline.txt
  3. add an empty file call ssh to the root of the SD card

This enables a virtual network adapter over the USB port and allows SSH. We can now boot the Pi with the SD card and connect with only the USB cable attached. The first boot will take a while.