]> rtime.felk.cvut.cz Git - novaboot.git/commitdiff
server: Add novaboot users to the novaboot group
authorMichal Sojka <michal.sojka@cvut.cz>
Tue, 15 Oct 2019 21:32:47 +0000 (23:32 +0200)
committerMichal Sojka <michal.sojka@cvut.cz>
Tue, 15 Oct 2019 22:29:02 +0000 (00:29 +0200)
This is mainly intended for allowing "Match Group" configuration in
sshd_config.

debian/novaboot-server.install
debian/novaboot-server.postinst [new file with mode: 0644]
server/adduser-novaboot
server/sysusers.d/novaboot-server.conf [new file with mode: 0644]

index d82c57a102fbb0c20d64f40d10faed8a62eda456..15050f649bf4d8665df131c64273436115a7fd1d 100644 (file)
@@ -6,3 +6,4 @@ server/systemd/novaboot-server-session@.service /lib/systemd/system
 server/systemd/novaboot-target-off@.target /lib/systemd/system
 server/systemd/novaboot-target-off@.timer /lib/systemd/system
 server/systemd/novaboot-target-on@.service /lib/systemd/system
+server/sysusers.d/novaboot-server.conf /usr/lib/sysusers.d
diff --git a/debian/novaboot-server.postinst b/debian/novaboot-server.postinst
new file mode 100644 (file)
index 0000000..e8bf2d6
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+set -e
+
+case "${1}" in
+    configure)
+        if ! getent group novaboot >> /dev/null 2>&1; then
+            addgroup --quiet --system novaboot
+        fi
+    ;;
+esac
+
+#DEBHELPER#
index 69e6f49e957e223c44f574c107a9612f476040e8..928e76358cb4bc01dbee7449da8ef380c469e602 100755 (executable)
@@ -49,7 +49,7 @@ fi
 [ -z "$key" -o "$(echo "$key" | wc -l)" -ne 1 ] && die "--key needs to be just one line"
 echo "$key" | grep -q ssh || die "--key does not look like an SSH public key"
 
-adduser --disabled-password --shell $(which novaboot-shell) $adduser_opts "$@"
+adduser --disabled-password --ingroup novaboot --shell $(which novaboot-shell) $adduser_opts "$@"
 
 user="$1"
 home=$(getent passwd "$user"|awk -F: '{print $6;}')
diff --git a/server/sysusers.d/novaboot-server.conf b/server/sysusers.d/novaboot-server.conf
new file mode 100644 (file)
index 0000000..667e527
--- /dev/null
@@ -0,0 +1 @@
+g novaboot - -