0

I followed several steps to get an SSH over USB working. I followed the steps posted here. My Raspberry Pi Zero is connected with a standard micro USB cable to my desktop computer (Ubuntu 16.04). Desktop is running the avahi-daemon. I used the pi usb port labelled 'data'.

My pi is booted and running. ifconfig shows the Raspberry pi is connected (enp0s22f2u2i1 Link encap:Ethernet). It also has an inet6 address. SSH to this i6 adress returns a port 22: network is unreachable. Also ssh pi@raspberrypi.local as posted in the tutorials gives an error: ssh: Could not resolve hostname raspberrypi.local: Name or service not known.

I gave the rapsberry pi an IP adress using ifconfig enp0s22f2u2i1 192.168.1.222. Ubuntu gives me a notification that the device is connected, however I still can't SSH to the Pi (ssh pi@192.168.1.222). But this time the error message is different: ssh: connect to host 192.168.1.222 port 22: Connection refused.

What else can I try to get SSH over USB to my Pi Zero working? Perhaps I do need to adjust the setting for the bonjour service (avahi-daemon) running on my desktop?

Timtico
  • 109
  • 1
  • 3
  • What is are you using on the Pi? – Mohammad Ali Nov 14 '16 at 00:46
  • 1
    How are you running ifconfig on the Pi if the data cable is connected to another computer but you cannot connect to the Pi? If you are running ifconfig on the other computer, you didn't assign an IP to the Pi, you assigned it to the enp0... interface on that computer. That's not part of the Pi. That's a USB ethernet link on the PC/laptop/whatever. The pi is on the other end, but if you can't log into it, you can't configure the Pi side that way. – goldilocks Nov 14 '16 at 04:28
  • I run ifconfig on the desktop side, since that side is running the bonjour service. Basically my question boils down to how to setup the avahi-daemon, since obviously the standard configuration is not working. What is the best way to test if the mDNS is enabled on the raspberry pi side? – Timtico Nov 14 '16 at 09:19
  • @MohammadAli I would like to answer, but can you clarify your question? – Timtico Nov 14 '16 at 09:24
  • @Timtico I ment to say "OS" as in operating system – Mohammad Ali Nov 14 '16 at 13:11
  • @MohammadAli The operating system running on the Pi is Rasbian Jessy with Pixel (kernel version 4.4) – Timtico Nov 14 '16 at 14:00

3 Answers3

1

I am almost 100% sure that means your ssh is not enabled. Go to raspi-config and enable it from there.

tlhIngan
  • 3,372
  • 5
  • 19
  • 33
  • 1
    the ssh was already enables. avahi-browseon my desktop connected to the pi shows the pi services (host name is p)
    Found service 'p' of type '_udisks-ssh._tcp' in domain 'local' on 3.1.
    Found service 'p [f6:ea:85:b7:36:ba]' of type '_workstation._tcp' in domain 'local' on 3.1.
    
    – Timtico Mar 04 '17 at 10:34
0

On your ubuntu machine, open the network interface settings and under ipv4 settings change the method drop-down to link-local. You should see the connection suddenly reconnect (if not, manually disable then re-enable the interface) and then the ssh will work as described.

What i havent been able to work out is how to share my internet connection from the ubuntu host to the pi

0

The first thing I would to is to run avahi-browse -art to see if the laptop discovered the RPi and what kind of address (IPv4 or IPv6) it has. I assume that it is IPv6, in that case you have to specify the right network interface when running the SSH client:

ssh -6 pi@raspberrypi.local%enp0s22f2u2i1 

This is the flip side of IPv6 protocol: every device on the network has an IP address (yay!) but exactly because of this, ssh has no idea where to send the data if you specify just the address. fe80::X:X:X addresses are valid for every IPv6 network interface, so if your laptop has more than one, SSH will need an extra hint. Technically you don't really need to specify the -6 argument, but debugging gets easier when you know exactly which protocol is concerned.

If that doesn't help, try disabling IPv6 for mDNS. Apparently, setting publish-aaaa-on-ipv4=no and use-ipv6=no in avahi-daemon.conf is enough, if you need IPv6 running for other purposes. Otherwise, you can disable IPv6 completely.

Dmitry Grigoryev
  • 27,928
  • 6
  • 53
  • 144