- Download desired OS image from https://www.raspberrypi.com/software/operating-systems/ and unzip.
- Image SD Card with Raspberry OS:
$ sudo dd if=2021-10-30-raspios-bullseye-armhf-lite.img of=/dev/sdc bs=4M conv=fsync status=progress
- Create wpa_supplicant.conf at root of boot partition:
$sudo vi /media/myuser/wpa_supplicant.conf
Contents of wpa_supplicant.conf:
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=US
network={
ssid="myssid"
psk="mywifipassword"
key_mgmt=WPA-PSK
}
- Create ssh file at root of boot partition:
$ sudo touch /media/myuser/boot/ssh
- Insert SD Card in Pi and power on.
- Login to pi over ssh. Username "pi", password "raspberry".
- Change password for pi to something different,
passwd
. - Set password for root,
sudo passwd root
. - Do apt update and apt upgrade,
sudo apt update
andsudo apt upgrade
. - Install vim and set editor to vim-basic:
$ sudo apt install vim
$ sudo update-alternatives --config editor
- Edit /etc/ssh/sshd_config to make
PermitRootLogin yes
. - Use
raspi-config
to:- change hostname
- set locale
- set timezone
- expand disk
- Test network connectivity (like, ping your gateway and /etc/resolv.conf).
- Prevent wifi going to sleep by adding this line to /etc/rc.local just above
exit 0
:
iwconfig wlan0 power off