- Raspberry Pi 3, 3+ or 2 (only)
- A Linux PC, laptop or Raspberry with SD card reader/slot
- A number of Raspberry Pis configured with Ethernet
You must have an SSH key, if you don't know what this is then type in ssh-keygen
and follow the instructions.
- Clone the gist and run
chmod +x make-rpi.sh
- Download the Raspbian Lite image and place it in the folder
- Insert a formatted SD card into your SD card reader
- Edit
make-rpi.sh
and update:export DEV=
to the device you see onlsblk
(ordiskutil list
on Mac) for your SD card readerexport IMAGE=
to the filename of the image you dowloadedexport COUNTRY_CODE =
to your 2-letter ISO 3166 country codeexport SSH_PUB_KEY=
to the location of the SSH key to be used for logging in to the piexport SSID =
to the wifi network you want the RPi to joinexport PSK =
to the wifi password of the network
- Edit
template-dhcpcd.conf
if your IP range isn't192.168.0.0/24
- Run
sudo ./make-rpi node-1
to getnode-1.local
and so on.
- For security log-in by password is disabled. If you want to log in via password then comment out the lines in
make-rpi.sh
- Do not push any private passwords such as WiFi to a public repository
- Flashes SD card
- Mounts card to machine
- Adds SSH keys to RPi
- Enables SSH on the RPi
- Disables password login (so we have to use SSH keys)
- Sets the RPi hostname
- Reduces GPU memory on RPi
- Sets RPi static IP
- Configures RPi wifi connectivity