raspberry-pi.md 2.4 KB


title: Raspberry Pi breadcrumbs:

  • title: Configuration
  • title: IoT & Home Automation --- {% include header.md %}

Using

{:.no_toc}

OS: Raspbian Buster

Hardware models: B, 3B

Setup

Installation

  1. Download Raspbian: Download Raspbian (Raspberry Pi)
    • Use the desktop version for DE and the Lite version for no DE.
  2. Burn it to the SD card.
  3. Mount the SD card in the Raspi and power it on.

Basic Setup with Desktop Environment

  1. Follow the configuration wizard.
    • Set a password for the "pi" user.
  2. Turn off Bluetooth and/or Wi-Fi if not used.
  3. In "Raspberry Pi Configuration":
    1. (Optional) Disable auto login.
    2. Disable all unused interfaces.
    3. Fix the keyboard layout.

Basic Setup without Desktop Environment

  1. Default credentials: Username pi, password raspberry.
  2. Configure through the menu: raspi-config
    • Go through all the options.
    • Locale and default locale: Use en_US.UTF-8.
    • Disable all interfaces except SSH (disable SSH too if not needed).
    • If a black border is present, disable overscan.
  3. Upgrade the system and install stuff:
    • Upgrade: apt update && apt upgrade
    • Install basics: apt install vim htop screen
  4. Add personal admin user:
    1. Create user: adduser <user>
    2. Add SSH key (from a GitHub user in this case):
      1. cd /home/<user>
      2. mkdir .ssh
      3. curl https://github.com/<user>.keys >> .ssh/authorized_keys
      4. chown -R <user>:<user> .ssh
      5. chmod 700 .ssh and chmod 600 .ssh/*
    3. Make user sudoer: usermod -aG sudo <user>
    4. Let user see system logs: usermod -aG systemd-journal <user>
    5. Try logging into the user locally and through SSH.
  5. Delete default user: deluser pi
  6. Configure SSHD:
    • PermitRootLogin no
    • PasswordAuthentication no
    • AllowTcpForwarding no
    • GatewayPorts no
    • AcceptEnv LANG LC_*
    • Restart sshd and try to open a new session.
  7. Remove the MOTD: > /etc/motd

Applications

Raspotify

A Spotify Connect community client.

See dtcooper/raspotify (GitHub).

{% include footer.md %}