Skip to content

Instantly share code, notes, and snippets.

@jdrew1303
Last active October 1, 2018 23:19
Show Gist options
  • Save jdrew1303/64e71146bb8aac65b5a97a258bbf978a to your computer and use it in GitHub Desktop.
Save jdrew1303/64e71146bb8aac65b5a97a258bbf978a to your computer and use it in GitHub Desktop.
setting up raspberry pi for headless operation

Enable SSH

To enable SSH, first navigate to the boot directory:

cd /Volumes/boot Now create an empty file called "ssh":

touch ssh This will enable SSH when the Pi is booted.

Enable WiFi

In order to SSH into your Pi, you'll need to be connected to your local network. You can, of course, use Ethernet, but if you're using the Raspberry Pi 3, you've got WiFi built-in. So let's add our WiFi configuration to the Pi so it's available when we boot.

Navigate to the boot directory:

cd /Volumes/boot

And create a file called wpa_supplicant.conf. Add the following to this file:

For Raspbian Jessie:

network={
    ssid="YOUR_NETWORK_NAME"
    psk="YOUR_PASSWORD"
    key_mgmt=WPA-PSK
}

For Raspbian Stretch:

country=IE
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
    ssid="YOUR_NETWORK_NAME"
    psk="YOUR_PASSWORD"
    key_mgmt=WPA-PSK
}

You'll need to add your wireless network name and password.

SSH into your Pi

ssh pi@raspberrypi

Enable VNC

sudo apt-get update
sudo apt-get install realvnc-vnc-server realvnc-vnc-viewer

You can enable VNC Server at the command line using raspi-config: sudo raspi-config

Now, enable VNC Server by doing the following:

  • Navigate to Interfacing Options.
  • Scroll down and select VNC > Yes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment