Most of the time I use a headless Raspberry Pi which I want to access via ssh. These are the steps to do that.
- Find the disk number of the SD card with
diskutil list
- Unmount the disk with
diskutil unmountDisk /dev/disk<number>
- Copy data on the SD card with
sudo dd bs=1m if=<img-file> of=/dev/rdisk<number> conv=sync
- Configure ssh and WiFi settings as described on stackoverflow
- Enable ssh by creating an empty file at
/Volumes/boot/ssh
- Configure WiFi by providing a file at
/Volumes/boot/wpa_supplicant.conf
with the following content
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="<ssid>"
psk="<pwd>"
}
- Check if the Raspberry Pi is connected to the WiFi with
ping raspberrypi.local
- ssh onto it with
ssh pi@rasbperrypi.local
(password israspberry
)
If WiFi is not needed at all, you can disable it with iwconfig wlan0 txpower off
. Use on
to turn it on again.