1

I know this has been asked before but I can't find a solution that works for me so I'm going to try asking again. I'm using a Pi Zero W headless and trying to SSH into it from my Ubuntu 18.04 machine via USB. I've set IPv4 to link-local and set IPv6 to disabled.

Running ifconfig -a shows my Pi as enp2s0f0u1 with an IP 169.254.X.X so I know the addressing is working. When I run ssh [email protected] I get Connection refused. If I run ssh [email protected] I get No route to host.

Any help or recommendations would be appreciated

Edit:

Ubuntu

ifconfig

enp9s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
        inet 192.168.13.44 netmask 255.255.0.0 broadcast 192.168.255.255
        inet6 fe80::b49e::2839::1fcd::30eb prefixlen 64 scopeid 0x20<link>
        ether e0:d5:5e:6f:84:37 txqueuelen 1000 (Ethernet)
        RX packets 1718078 bytes 144625927 (144.6 MB)
        RX errors 0 dropped 100 overruns 0 frame 0
        TX packets 1667922 bytes 139285417 (139.2 MB)
        TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
        inet 127.0.0.1 netmask 255.0.0.0
        inet6 ::1 prefixlen 128 scopeid 0x10<host>
        loop txqueuelen 1000 (Local Loopback)
        RX packets 71351 bytes 5099667 (5.0 MB)
        RX errors 0 dropped 100 overruns 0 frame 0
        TX packets 71351 bytes 5099667 (5.0 MB)
        TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

ip route

169.254.0.0/16 dev enps0 scope link metric 1000
192.168.0.0/16 dev enps0 proto kernel scope link src 192.168.13.44 metric 100

Raspberry Pi

ifconfig

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
        inet 127.0.0.1 netmask 255.0.0.0
        inet6 ::1 prefixlen 128 scopeid 0x10<host>
        loop txqueuelen 1000 (Local Loopback)
        RX packets 0 bytes 0 (0 B)
        RX errors 0 dropped 100 overruns 0 frame 0
        TX packets 0 bytes 0 (0 B)
        TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

usb0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
        ether 1a:61:7f:e8:cf:d1 txqueuelen 1000 (Ethernet)
        RX packets 0 bytes 0 (0 B)
        RX errors 0 dropped 100 overruns 0 frame 0
        TX packets 0 bytes 0 (0 B)
        TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

ip route shows nothing

12
  • 'connection refused' seems to indicate that the SSH server on the Pi0 is not active. Did you activate it? If you did, have you verified it's active?
    – Dirk
    Commented Jan 21, 2021 at 14:37
  • I have yeah I went through raspi-config and turned ssh on. I also checked status of sshd and it's active Commented Jan 21, 2021 at 14:45
  • IP starting with 169 is a self assigned address. Can you get a good IP address from a DHCP server and try again? What is the address of the Ubuntu machine? If they are not on the same subnet, they cannot see each other.
    – Bjinse
    Commented Jan 21, 2021 at 14:56
  • My Ubuntu machine is on /24 subnet. How would I go about finding a good IP from DHCP? Is that an nmap scan or is that a static IP I need to assign? (Sorry if that's a dumb question, still trying to learn all this stuff) Commented Jan 21, 2021 at 15:08
  • Just kidding, my Ubuntu machine is on /16 subnet Commented Jan 21, 2021 at 15:30

2 Answers 2

2

Running ifconfig -a shows my Pi as enp2s0f0u1 with an IP 169.254.X.X

This is the interface and its ip address on the Ubuntu device. It does not show anything about the RasPi. Your RasPi shows interface usb0 without an ip address. This cannot work. usb0 must have an ip address. Please fix the connection on the RasPi so that it get an ip address from the link-local address block 169.254.0.0/16.

0

Follow these steps:-

  1. Turn off your Raspberry Pi
  2. Remove your SD card and put into a card reader and connect to the computer.
  3. create an empty file named ssh inside the boot directory.
  4. put the SD card again into the raspberry pi.
  5. Now connect your raspberry pi via ssh
1
  • This was like the first step that I tried and it didn't work... Commented Jan 21, 2021 at 19:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.