What i’d hoped would take 1hr has almost been a day now. Has anyone had luck with SSHing into a Pi over USB? What steps did you take with which OS? The success stories i’ve read tend to be Windows/Mac, not many from Linux.
The Pi Zero has the latest Raspbian (Full) and is connected to my laptop running Debian (Bullseye) via it’s USB data port (not the power-only port).
All command outputs below are from my laptop:
lsusb # Output (Pi specific):
Bus 001 Device 034: ID 0525:a4a2 Netchip Technology, Inc. Linux-USB Ethernet/RNDIS Gadget
ip addr # Output (Pi specific):
4: enx8af6eead1756: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 8a:f6:ee:ad:17:56 brd ff:ff:ff:ff:ff:ff
inet6 fe80::88f6:eeff:fead:1756/64 scope link
valid_lft forever preferred_lft forever
ping fe80::88f6:eeff:fead:1756 # Output: (continuous)
64 bytes from fe80::88f6:eeff:fead:1756%enx8af6eead1756: icmp_seq=1 ttl=64 time=0.100 ms
ssh pi@fe80::88f6:eeff:fead:1756%enx8af6eead1756 # Output:
ssh: connect to host fe80::88f6:eeff:fead:1756%enx8af6eead1756 port 22: Connection refused
I’ve installed the OS to memory card adding the file “ssh” to the boot partition prior to first startup twice.
I’ve also gone in and manually turned on SSH using sudo raspi-config
with no difference.
As for getting a non-IPv6 address…
Right after imaging the card, I went into the boot partition and:
- Appended
dtoverlay=dwc2
to config.txt - Added
modules-load=dwc2,g_ether
right afterrootwait
in cmdline.txt keeping 1 space on either side.
I did sudo apt install avahi*
first on my laptop, tried connecting, then installed the packages on the Pi and tried again with no luck.
ssh pi@raspberrypi.local # Output:
ssh: Could not resolve hostname raspberrypi.local: Name or service not known
None of the following commands show anything:
- avahi-browse -art
- mdns-scan
- avahi-resolve-host-name raspberrypi.local
sudo systemctl status avahi-daemon # Output: (Running)
● avahi-daemon.service - Avahi mDNS/DNS-SD Stack
Loaded: loaded (/lib/systemd/system/avahi-daemon.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2020-08-18 22:07:14 BST; 3h 57min ago
TriggeredBy: ● avahi-daemon.socket
Main PID: 24475 (avahi-daemon)
Status: “avahi-daemon 0.8 starting up.”
Tasks: 2 (limit: 23825)
Memory: 1.6M
CGroup: /system.slice/avahi-daemon.service
├─24475 avahi-daemon: running [host.local]
└─24476 avahi-daemon: chroot helper
sudo avahi-autoipd --debug enx8af6eead1756 # Output:
Found user ‘avahi-autoipd’ (UID 114) and group ‘avahi-autoipd’ (GID 126).
Successfully called chroot().
Successfully dropped root privileges.
State transition START-0 → START-0
Starting with address 169.254.11.108
State transition START-0 → WAITING_PROBE-0
sleeping 433ms
Ignoring irrelevant ARP packet.
sleeping 228ms
State transition WAITING_PROBE-0 → PROBING-0
sending…
sleeping 1630ms
Ignoring irrelevant ARP packet.
sleeping 819ms
State iteration PROBING-1
sending…
sleeping 1401ms
State transition PROBING-1 → WAITING_ANNOUNCE-0
sending…
sleeping 1999ms
Ignoring irrelevant ARP packet.
sleeping 1274ms
Ignoring irrelevant ARP packet.
sleeping 222ms
State transition WAITING_ANNOUNCE-0 → ANNOUNCING-0
Callout BIND, address 169.254.11.108 on interface enx8af6eead1756
sending…
sleeping 1999ms
client: Error: Attribute failed policy validation.
sleeping 1982ms
Script execution failed with return value 2
Ignoring irrelevant ARP packet.
sleeping 1182ms
State iteration ANNOUNCING-1
sending…
sleeping 1999ms
Ignoring irrelevant ARP packet.
sleeping 266ms
Successfully claimed IP address 169.254.11.108
State transition ANNOUNCING-1 → RUNNING-0
sleeping -1ms
Ignoring irrelevant ARP packet.
sleeping -1ms
Ignoring irrelevant ARP packet.
sleeping -1ms
Ignoring irrelevant ARP packet.
sleeping -1ms
Ignoring irrelevant ARP packet.
sleeping -1ms
^CGot SIGINT, quitting.
Callout STOP, address 169.254.11.108 on interface enx8af6eead1756
Killing child.
Killing child.
Killing child.
Killing child.
Not entirely sure what the above command does but no joy pinging or SSHing into 169.254.11.108
The most valuable resources among the countless i’ve looked at:
Raspberry Pi WiFi Avahi mDNS config | Scientific Computing
Simple guide for setting up OTG modes on the Raspberry Pi Zero, the fast way! · GitHub
Headless Pi Zero SSH access over USB - Raspberry Pi Stack Exchange
Connect to a Raspberry Pi Zero with a USB Cable and SSH
Would be highly grateful for any good ideas on where to look from here or what I might be doing wrong.