Work-in-progress. This repository contains some scripts to prepare SD card images for the raspberry Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

17 lines
429 B

#!/bin/bash
SSH_PUBLIC_KEY=${1:-~/.ssh/id_rsa.pub}
set -euo pipefail
if [[ $EUID -ne 0 ]]; then
echo 'This script must be run as root!'
exit 1
fi
touch root/boot/ssh
# wpa_passphrase <ssid> <password> > wpa_supplicant.conf
cp wpa_supplicant.conf root/etc/wpa_supplicant/
mkdir -p root/home/pi/.ssh
cat "$SSH_PUBLIC_KEY" > root/home/pi/.ssh/authorized_keys
echo 'PasswordAuthentication no' >> root/etc/ssh/sshd_config