mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 00:14:32 +09:00
mkosi: Create testuser at runtime
Now that we have userdb credentials, let's ship testuser as a userdb credential instead of including it in the image.
This commit is contained in:
5
mkosi.credentials/userdb.group.testuser
Normal file
5
mkosi.credentials/userdb.group.testuser
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"groupName": "testuser",
|
||||
"gid": 4711,
|
||||
"disposition": "regular"
|
||||
}
|
||||
14
mkosi.credentials/userdb.user.testuser
Normal file
14
mkosi.credentials/userdb.user.testuser
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"userName": "testuser",
|
||||
"uid": 4711,
|
||||
"disposition": "regular",
|
||||
"enforcePasswordPolicy": false,
|
||||
"memberOf": [
|
||||
"wheel",
|
||||
"systemd-journal"
|
||||
],
|
||||
"shell": "/bin/bash",
|
||||
"privileged": {
|
||||
"hashedPassword": ["$1$kqp7NF1f$tNnQcshPX53CSfRKTQD0R1"]
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
z! /home/testuser 700 testuser testuser
|
||||
@@ -5,14 +5,6 @@ set -o nounset
|
||||
|
||||
find "$BUILDDIR" \( -name "*.rpm" -o -name "*.deb" -o -name "*.pkg.tar" -o -name systemd.raw \) -exec cp -t "$OUTPUTDIR" {} \;
|
||||
|
||||
useradd \
|
||||
--uid 4711 \
|
||||
--user-group \
|
||||
--create-home \
|
||||
--password "$(openssl passwd -1 testuser)" \
|
||||
--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
|
||||
# let's use the new name if it exists.
|
||||
|
||||
Reference in New Issue
Block a user