Skip to content

Instantly share code, notes, and snippets.

@kitallis
Last active November 26, 2020 11:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kitallis/7b5ba8ffb9045bd3dce6cd710e00f26a to your computer and use it in GitHub Desktop.
Save kitallis/7b5ba8ffb9045bd3dce6cd710e00f26a to your computer and use it in GitHub Desktop.
Setup rpi without display (headless)

Pre-req

  • Raspberry Pi 3
  • LAN Cable (tested on CAT6 cable)
  • USB Cable (2.x)
  • SD Card (class 10, >8gb)
  • Mac OS X (tested on Sierra and above)

Download

Install image

$ diskutil list
$ diskutil unmount /dev/disk#
$ sudo dd bs=1M if=/path/to/raspbian-jessie.img of=/dev/disk#

Enable SSH

  • touch /Volumes/boot/ssh

  • Raspbian will look for a file named ssh on the boot partition at startup and will enable sshd

Power up RPI

  • Plug in the USB cable
  • Insert the Micro SD card

Plug LAN

  • Connect an ethernet cable to your pi and the other end to your router and ensure the lights on the port are blinking

SSH

#
# find out the assigned IP
#

$ ifconfig | grep "inet "
$ nmap -n -sP 192.168.x.255/24

#
# password is raspberry
#
$ ssh pi@192.168.x.y

Enable sshd

#
# Select 5 - P2 - Yes
#
$ sudo raspi-config

Change password

#
# Select 1 - Ok
#
$ sudo raspi-config

Enable WiFi

  • Edit /etc/wpa_supplicant/wpa_supplicant.conf and add your SSID / Password
country=GB
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
    ssid="coffeegoat"
    psk="garbage"
    key_mgmt=WPA-PSK
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment