Sunday, July 2, 2017

Enable SSH for headless Raspbian install

When setting up a new Raspbian OS install I would always run into the situation where I had to connect to a monitor to complete the setup after flashing the SD card with the OS. Recently, I came across an article at Hackernoon on how to enable SSH from without even booting the pi and running raspi-config and it is so simple.

Let's start by flashing the SD card with Raspbian Jessie. I chose the lite version, because this is going to be a headless install and running as a mini home server for DNS and DHCP. Since my primary machine is running Ubuntu, I will be using dd to flash the SD card.


Once dd finishes, Ubuntu mounts the two partitions of the SD card, these appear on the launcher. The first one is the boot and the second one is the main partition.


Open the boot partition, create a new empty document named "ssh" and unmount the drive. Insert the SD card into the Raspberry Pi and find the IP address, from here you can SSH with the default pi username and password to finish the setup with raspi-config or any other method you choose to use. If you have any questions, feel free to leave a comment below. Thanks for reading!