0

I have just bought a Raspberry Pi 3B+ and want to setup by connecting it to my Macbook Pro via Ethernet connection.

I can ping the raspberry pi IP address

$ ping raspberrypi.local
PING raspberrypi.local (192.168.2.2): 56 data bytes
64 bytes from 192.168.2.2: icmp_seq=0 ttl=64 time=0.482 ms
64 bytes from 192.168.2.2: icmp_seq=1 ttl=64 time=0.642 ms
64 bytes from 192.168.2.2: icmp_seq=2 ttl=64 time=0.484 ms

But I fail to ssh to the raspberry pi

$ ssh pi@raspberrypi.local
ssh: connect to host raspberrypi.local port 22: Connection refused

There seems to be a problem on my network connection but I am not sure if it is related to the above issue. USB 10/100/1000 LAN has a self-assigned IP address and will not be able to connect to the Internet. (I have Internet sharing enabled)

EDIT: I have NOOBS installed.

  • 3
    It looks like you've not enabled SSH. Did you place a file named ssh into your /boot directory before you booted the RPi? – Seamus May 4 at 17:06
  • So, I should enable SSH for RPi, right? But it is the first time setup, how can I do that? Thanks – K_inverse May 4 at 17:20
  • Are you headless, or do you have a monitor connected? – Seamus May 4 at 17:25
  • I only connect the RPi to MacBook Pro via the Ethernet cable – K_inverse May 4 at 17:37
  • OK... I'll post an answer below, but first: Re the item in your question "LAN has a self-assigned IP address", what is your Macbook's IP address? – Seamus May 4 at 17:47
1

@Seamus has it correctly in his comment. Here is the official doc on it though, in case you need it: RaspberryPi Remote Access with SSH - basically use the 'sudo raspi-config' command to access the configuration menu and enable it. It is off by default for basic security reasons. (and yes, it used to be default ON, and a lot of posts still reference it from that time period but are no longer accurate)

Additionally, that doc has instructions for simply editing the config on another system and replacing the card back into the Pi as a headless solution (as indicated by @Seamus).

0

It appears from the throwaway comment in your question (I have Internet sharing enabled) that your Pi is directly connected to a computer.

You can have EITHER ICS OR ssh etc access to the Pi, not BOTH.

It is not impossible to have both, but this requires additional software and complex configuration on the host system, and this is off-topic for this site. NOTHING you can do on the Pi is going to make it work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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