Skip to content

Setup Raspberry Pi 3

msinn edited this page Apr 23, 2017 · 5 revisions

Setup Raspberry Pi 3

This setup guide assumes you are working with Linux or MacOs on your desktop computer.

Create SD card with Raspbian operation system

  • Download Raspbian Jessie or Jessie-Lite image from raspberrypi.org
  • Write Raspbian image to micro-SD card:
    • on MacOS use the tool Etcher to create the card. Etcher can be downloaded here

Enable ssh on Raspbian (before first boot)

  • after writing the image to the card, mount the image to your desktop computer
    • Etcher does that automatically
  • copy an empty file to the mounted boot partition. The file must be named ssh (without extension)
  • enter the micro-SD card into the Raspberry Pi
  • Connect the Raspberry Pi to your ethernet network
  • boot up your Raspberry Pi

Setup login to Raspberry Pi with RSA key instead of password

Create a RSA key-pair

If you haven't done already, create a key pair id_rsa / id_rsa.pub in the .ssh folder of your home folder. This is done using the following command:

ssh-keygen -t rsa

The benefit is, that you don't have to enter the password every time you connect to your Paspberry Pi.

If you specify a filename for the key files using -f the files are written to the current directory and you have to move the file to the .ssh folder yourself. If you specify a passphrase (you are asked for one), this passphrase must be entered before your operating system can access your private key.

Copy the public key to the Raspberry Pi

Using the following command you can install the public key in the .ssh-folder of the default user pi. To install the public key, you have to enter the password for the user *pi. The initial password for the user pi is raspbian.

cat ~/.ssh/id_rsa.pub | ssh -o StrictHostKeyChecking=no pi@<ip-of-RaspberryPi> mkdir .shh && ’umask 0077; cat >>.ssh/authorized_keys'

Initial configuration of the Raspberry Pi

Login to Raspberry Pi

ssh pi@<ip-of-RaspberryPi>

If you want to ignore warnings about conflicts with your known_hosts file, use this command

ssh -o StrictHostKeyChecking=no pi@<ip-of-RaspberryPi>

Start the configuration

sudo raspi-config

and change the following settings:

  1. Change Password for the user pi
  2. Modify hostname of your Pi
  3. Set boot-options: B1: Desktop / CLI
  4. Change locale: I1 - I3: adjust keyboard (example: de_DE.UTF-8), timezone and country for wlan

Exit the config tool with the option to reboot the Raspberry Pi

WLAN configuration

Login to Raspberry Pi

ssh pi@<ip-of-RaspberryPi>
  • sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
    • set country to the country you are in
    • add:
 network={

     ssid="<wlan>"
     psk="<wlan password>"

     key_mgmt=WPA-PSK
 }
  • Restart the network interface
sudo ifdown wlan0 && sudo ifup wlan0
  • Get newest updates for Raspbian:
    sudo apt-get -y update
    sudo apt-get -y upgrade
    sudo apt-get -y autoremove