My default setup of any archlinux ARM device (f.ex raspberry pi)

This tutorial is for GNU/Linux host machines.

Initially follow the guide on the Installation tab of your device (or search a guide to flash the SD-card for your device):

  • RPI-3
  • RPI-4

  • or another tutorial where you only flash the initial content of the SD-card

Plug the RPI to a network accesible from your host machine.

  • ssh alarm@IP-of-ALARM
  • pacman-key --init
  • pacman-key --populate archlinuxarm
  • sudo vim /boot/config.txt

    • add row "hdmi_force_hotplug=1"
    • This is to ensure that the device will boot normally even though no HDMI display is attached
  • su (switch to root)

  • vim /etc/locale.gen
    • uncomment the row (remove the # character) with #en_US.UTF-8 (or whatever locale you prefer)
  • locale-gen
    • generates the locale files
  • pacman -Syu tmux bash-completion iwd vim htop rsync moreutils
    • Installs some basic programs
  • visudo and add row: "alarm ALL=(ALL) ALL"
    • allows the user alarm to run a program as root (f.ex.: sudo vim PATH)
  • run ifconfig and find your interface name (here mine is wlan0, replace with name of your desired interface)
  • create /etc/systemd/network/wlan0.network with the following content:
[Match]
Name=wlan0

[Network]
DHCP=yes
  • (If you want to use iwd and it's supported by your kernel) Disable wpa_supplicant an use iwd (you can also skip this if you don't want to use iwd)
    • systemctl disable wpa_supplicant
    • systemctl start iwd
    • systemctl enable iwd (enable autostart of this service)
    • create file /var/lib/iwd/SSID.psk with content:
[Security]
Passphrase=YOUR_WLAN_PASSPHRASE

[Settings]
AutoConnect=True
  • passwd (change root password)
  • exit to switch back to the default user
  • passwd (change alarm password)

Firewall (if needed)

  • install ufw
sudo pacman -S ufw
  • allow ssh connections on port 22
sudo ufw allow ssh  
  • enable ufw firewall
sudo ufw enable
sudo systemctl enable ufw

zsh (if you want a fancy shell)

  • install zsh
sudo pacman -S zsh
  • zsh setup

  • thoughts: wireguard, new user (useradd new_name), openssh hardening