Post installation - initial setup
After booting up for the first time I want to bring up the network, add the user, switch from sudo to doas, install mksh.
Network
After booting into the fresh install the network won’t work - that’s because the dhcpcd isn’t running, so we start it up:
# ln -s /etc/sv/dhcpcd /var/service/
Install mksh
# xbps-install -S mksh
Adding the main user
# useradd -m -s /bin/mksh -U -G wheel,users,audio,video,cdrom,input chain
# passwd chain
Switch from sudo to doas
First we install doas
# xbps-install -S opendoas
Now we set it up so that anyone in wheel group can execute stuff as root. We’ll also allow anyone in wheel to poweroff and reboot the system without being prompted for a password.
# echo -e "permit persist :wheel\npermit nopass :wheel as root cmd poweroff\npermit nopass :wheel as root cmd reboot" > /etc/doas.conf
# chown -c root:root /etc/doas.conf
# chmod -c 0400 /etc/doas.conf
doas.conf should look like so
permit persist :wheel
permit nopass :wheel as root cmd poweroff
permit nopass :wheel as root cmd reboot
At this point it’s prudent to test it, because if we’ve made a mistake here(like a typo) we might get in trouble later after we disable the root account login.
# doas -C /etc/doas.conf && echo "config ok" || echo "config error"
If that works then we can proceed.
At this point we’ll add sudo to the list of ignored packages and remove it, and fake its presence by creating a symlink:
# echo "ignorepkg=sudo" > /etc/xbps.d/ignore_sudo.conf
# xbps-remove sudo
# ln -s /usr/bin/doas /usr/bin/sudo
Disable root account login
doas passwd --lock root
Install extra console fonts and increase font size to 16x32 (this is needed specifically for HiDPI displays)
doas zfs set org.zfsbootmenu:commandline="ro quiet fbcon=font:TER16x32" zroot/ROOT
doas xbps-install -S terminus-font
doas echo "FONT=ter-232b.psf.gz" >> /etc/rc.conf