Headless Raspberry Pi with a Mac

Peter Flickinger
3 min readMay 16, 2019

--

So after getting my first Raspberry Pi, I went on a crazy hunt to get a monitor, keyboard, mouse and so on, that I ended up gutting half the house to get everything set up. After some online hunting, I found a solution! A headless setup. Headless means no monitor, keyboard, mouse, or other hardware. Since I don’t have an ethernet dongle for my Mac #dongleLife I decided to get a wifi chip and use a wireless headless setup.

The OS

If you haven’t already download the lite version of Raspbian. Unzip the file and burn it on your SD Card. I use Etcher which is a straight forward drag and drop.

Etcher

After you burn the OS onto the card unplug and replug your SD card in so it shows up on your desktop.

Before we run the OS on your Raspberry Pi we need to allow access for ssh connections (allow remote connections) and let your pi know how to connect to your wifi.

The Setup

On a Mac navigate to the SD card by using cd. I called my SD card boot so I navigated to cd /Volumes/boot/.

To allow ssh connections add a file called ssh by running touch ssh.

For setting up wifi create a wpa_supplicant.conf file by running touch wpa_supplicant.conf.

You can use any text editor you want but to use terminal I ran nano wpa_supplicant.conf. Paste in your file contents from the chucks bellow and then press control-X, type Y, and then enter to save the file.

Based on your wifi security type fill wpa_supplicant.conf with the following. SSID -- Wifi Name PSK -- Password Password: Password:

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=US
network={
ssid=”«Your SSID»”
psk=”«Your password»”
key_mgmt=WPA-PSK
}

No password:

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=US
network={
ssid="«Your SSID»"
key_mgmt=NONE
}

Corporate/University Login:

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=US
network={
ssid="«Your SSID»"
proto=RSN
key_mgmt=WPA-EAP
pairwise=CCMP TKIP
group=CCMP TKIP
identity="<<Your User Name>>"
password="<<Password>>"
phase1="peaplabel=0"
phase2="auth=MSCHAPV2"
}

SSH

I found ipscanner to be a good tool on Macs for finding your Pi’s IP address. Once it is installed just search for pi. The app has bad reviews but that's mostly about the pricing. Since we just need to find a single IP address the free version will do the trick.

Log in over SSH to your pi by using ssh pi@<<Pi's Ip Address>> (it should look like ssh pi@101.102.32.1) and ignore the security warning by typing yes.

The default password is raspberry

Use ~. to exit ssh.

Congrats! You now have a headless raspberry pi that you can access anywhere on your network. No more having to deal with VGA and HMDI cords. Right now you send commands to your PI and view data.

For viewing/editing files I recommend CyberDuck.

--

--

Peter Flickinger
Peter Flickinger

No responses yet