1

I'm trying to connect to a Raspberry Pi using the command ssh pi@raspberrypi.local (using Raspbian Stretch Lite) over Ethernet so I can configure Wifi on the Pi. However I keep on running into this error. ssh: Could not resolve hostname raspberrypi.local: Name or service not known

I'm also not seeing any activity on the Ethernet – normally I'd expect to see a "connecting" message.

How can I fix this problem?

Aurora0001
  • 6,357
  • 3
  • 25
  • 39

3 Answers3

1

The problem is that Stretch does not run Bonjour out of the box, so the name of your Pi is unknown. You should be able to connect if you:

  1. Create an empty file named ssh in the root of your SD card, and
  2. Figure out the IP address of the Pi (see here if you don't know how), and finally
  3. ssh pi@<the IP address>

Note also that if you are connecting directly from you Linux machine to the Pi there is a slim chance that something is failing in the auto-crossover negotiation and the network isn't up, you can check this by looking for flashing lights at the Ethernet plugs and also by running ifconfig on the Linux machine to see if the network is up.

dlu
  • 467
  • 3
  • 19
1

I feel the easiest way to configure wifi on your RPi is to edit the /boot/wpa_supplicant.conf file on your microSD card. In your case, you'll remove the microSD card from your RPi, put it in a suitable card reader, plug that into your Windoze/Mac/Linux laptop/desktop, and edit the file in your favorite text editor (see NOTE below).

Once you've made the necessary edits, re-insert the microSD card in your RPi, and you'll have wifi when you boot up. There are some instructions on what entries are appropriate for the wpa_supplicant file here, but don't be confused by the fact that this guide references /etc/wpa_supplicant.conf. It's the same file that's in /boot.

NOTE: /boot on current versions of Raspbian is an SMB partition, and so is accessible from any OS and editor!

Seamus
  • 23,558
  • 5
  • 42
  • 83
0

that is because you are trying to do a connection end to end between your pi and your computer but there is nothing on the pi to respond to the computer request

start by enabling ssh on the, on the /boot partition add a file called ssh connect the pi through ethernet to your router, it will get an IP, then on your pc execute

sudo apt-get install -y nmap
hostname -I #this will return something like 192.168.x.x

now look for your pi with

  sudo nmap -sn 192.168.x.0/24

you will get something like

Nmap scan report for 192.168.15.1
Host is up (0.018s latency).
MAC Address: 4A:02:71:67:4B:E6 (Unknown)
Nmap scan report for 192.168.1x.2
Host is up (0.070s latency).
MAC Address: 88:78:73:84:26:5A (raspberrypi)
Nmap scan report for 192.168.x.3
...

now simply ssh to your pi with

ssh pi@192.168.x.3 #pass raspberry

once inside, configure the wifi

sudo raspi-config

you can also use /etc/wpa_supplicant/wpa_supplicant.conf to set the network

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
    ssid="YOUR_SSID_HERE"
    psk="YOUR_SECRET_PASSPHRASE_HERE"
    id_str="SOME_DESCRIPTIVE_NAME"
}