Create missing groups before adding the kiosk user (no netdev on 26.04)

Reported on a 26.04 offline install, first-boot step 2:
  useradd: group 'netdev' does not exist
useradd refuses to create the user at all when any -G group is missing,
which stopped provisioning. Ubuntu 26.04 Server's base system has audio,
video, input and plugdev but no netdev (checked against the 26.04.1
ISO's /etc/group).

provision_create_kiosk_user now `groupadd -f -r`s each supplementary
group first (a no-op when it exists), then passes the same list to
useradd.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cjz8a58eB5P9sUweqd3NHm
This commit is contained in:
Claude
2026-10-09 16:55:11 +00:00
parent 50cf0bef1d
commit b0c0008d44
+10 -1
View File
@@ -94,8 +94,17 @@ provision_install_packages() {
provision_create_kiosk_user() {
echo "[2/10] Creating kiosk user..."
local kiosk_groups=(audio video input plugdev netdev)
# Not every Ubuntu release ships all of these - 26.04 Server has no
# netdev group - and useradd refuses to create the user at all if any
# -G group is missing. Create missing ones as plain system groups
# (no-op when they exist).
local g
for g in "${kiosk_groups[@]}"; do
sudo groupadd -f -r "$g"
done
if ! id "$KIOSK_USER" &>/dev/null; then
sudo useradd -m -s /bin/bash -G audio,video,input,plugdev,netdev "$KIOSK_USER"
sudo useradd -m -s /bin/bash -G "$(IFS=,; echo "${kiosk_groups[*]}")" "$KIOSK_USER"
echo "$KIOSK_USER:kiosk" | sudo chpasswd
log_success "Kiosk user created (default password: kiosk - change it)"
else