mkosi: Beef up testuser a bit

Give it a password and add it to some common groups.
This commit is contained in:
Daan De Meyer
2024-07-31 18:32:53 +02:00
parent b3db96f230
commit 3fe25d4530
2 changed files with 15 additions and 1 deletions
+1
View File
@@ -43,6 +43,7 @@ Packages=
glibc-locale-base
gnutls
grep
group(wheel)
gzip
iputils
kernel-default
+14 -1
View File
@@ -3,7 +3,20 @@
set -e
set -o nounset
useradd --uid 4711 --create-home --user-group testuser
if [[ "$DISTRIBUTION" =~ ubuntu|debian ]]; then
SUDO_GROUP=sudo
else
SUDO_GROUP=wheel
fi
useradd \
--uid 4711 \
--user-group \
--create-home \
--password "$(openssl passwd -1 testuser)" \
--groups "$SUDO_GROUP",systemd-journal \
--shell /bin/bash \
testuser
if command -v authselect >/dev/null; then
# authselect 1.5.0 renamed the minimal profile to the local profile without keeping backwards compat so