Headless Raspberry Setup

Last updated 5 months ago

Setup a Raspberry Pi headless with ssh enabled.

Tested: Working (15 June 2018)

Download Raspbian from https://www.raspberrypi.org/downloads/raspbian/

Unzip the downloaded file

Copy the image to the SD-card

sudo dd if=2018-04-18-raspbian-stretch-lite.img of=/dev/mmcblk0 bs=4M status=progress

Add the file ssh in the boot partition.

Create the file wpa_supplicant.conf in the boot partition

Copy Wi-Fi settings into this file

wpa_supplicant.conf
country=US
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="your-ssid"
scan_ssid=1
psk="your-password"
key_mgmt=WPA-PSK
}

After booting you can add your ssh keys to the raspberry to login without entering the password every time (eg. Raspberry ip is 10.0.0.42).

ssh-copy-id pi@10.0.0.42

If you don't have ssh keys setup yet you can do so by

ssh-keygen