Skip to content

Instantly share code, notes, and snippets.

@angrychimp
Created March 22, 2018 22:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save angrychimp/c6ea75ab6447c9f36a5a8d7db9f41935 to your computer and use it in GitHub Desktop.
Save angrychimp/c6ea75ab6447c9f36a5a8d7db9f41935 to your computer and use it in GitHub Desktop.
How to get wi-fi and SSH working via image adjustments prior to a first boot.
  1. Download the image
  2. Flash the image to your microSD using Etcher
  3. Unmount/remount the microSD as necessary
  4. For wi-fi, add a file to the root folder named wpa_supplicant.conf
    • Content can be generated using
      read -p "SSID: " ssid
      read -s -p "Passphrase: " passphrase
      psk=$(wpa_passphrase $ssid $passphrase)
      echo "country=US
      ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
      update_config=1
      $(echo "$psk" | grep -v '#psk')" > wpa_supplicant.conf
  5. For SSH, add an empty file to the root folder named ssh:
    • Simply run touch ssh
  6. Unmount the card, and boot the device.
  7. After it boots, you should be able to log in using the default username/password pi/raspberry
  8. Make sure to change the default password after logging in
  9. Run updates
    • sudo apt-get update -y
    • sudo apt-get upgrade -y
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment