raspbian / raspberry pi os
create user for ssh on headless pi
the raspberry pi OS doesn’t ship with the pi user anymore (see here for more information and how to create a user), they have outlined several ways how to create a user. so here’s my own copy paste reference for the future when I need a user on a headless pi:
generate an encrypted password:
the openssl version which ships by default with macOS doesn’t support generating sha512 passwords, so I’m using the homebrew version:
/opt/homebrew/opt/openssl/bin/openssl passwd -6copy your generated password, and create a new file on the sd card:
vi /Volumes/bootfs/userconf.txtthe contents should look like username:password, for example:
jonas:$6$WI1IQhq59s3IayNg$h/CZGHz/hlH4ksVgW8mI5kWyZ1vURk3KCFcLajACuIfsUiITYW1zapqC8ov4AHBatpHdpM/uJ5IfSob0y2nBY.enable ssh on boot / headless login
headless login, you know: create a file named ssh on the boot volume, ex:
touch /Volumes/bootfs/sshconfigure wifi
same as with ssh, create a file called wpa_supplicant.conf in the boot volume, like so:
/Volumes/bootfs/wpa_supplicant.confconfigure wifi on raspberry pi os 12 / bookworm
for some reason things are becoming more complicated with raspberry pi os.
this is how you can do it with a TUI:
sudo nmtuior CLI:
sudo nmcli connection add type wifi ifname wlan0 con-name "MyNetwork" ssid "MyNetwork"install stable kernel / firmware
in case you played around with rpi-update and things went wrong:
apt-get update
sudo apt install --reinstall raspberrypi-bootloader raspberrypi-kernel raspi-firmware