commit 16e55eafd0131507c7535ebea568ac4120a77686
parent 82c987f33daad95f15dad37f7cacb49c7684cf7c
Author: Jan Pobrislo <ccx@webprojekty.cz>
Date: Tue, 26 Jul 2022 21:44:24 +0200
Set root login shell to /bin/zsh
Diffstat:
3 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/postinstall.aat b/postinstall.aat
@@ -1,3 +1,4 @@
+|### Functions ###
|function passwd_user(line, grep1) {
/etc/passwd f +
!f awk 'BEGIN { FS=OFS=":"; seen=0; line="{{line}}"; split(line, a) }
@@ -59,6 +60,7 @@
printf '%s\n' '{{pre match_str post}}' >> "$fname"
fi
|}
+|### postinstall.fileset ###
|END{
/boot +
/boot/extlinux.conf +
@@ -93,6 +95,8 @@ CN # Managed by /usr/src/core-system
/etc/group +
|line_append_file("sshd:x", ":22:", "", "^[^:]*:[^:]*")
+/etc/passwd f +
+!f sed -iEe 's|^(root:.*:)[^:]|/bin/zsh|'
|passwd_user("sshd:x:22:22:server privilege separation,,,:/home/sshd:/sbin/nologin")
|shadow_user("sshd:!:10000::::::")
diff --git a/postinstall.fileset b/postinstall.fileset
@@ -45,6 +45,8 @@ CN # Managed by /usr/src/core-system
fi
/etc/passwd f +
+!f sed -iEe 's|^(root:.*:)[^:]|/bin/zsh|'
+/etc/passwd f +
!f awk 'BEGIN { FS=OFS=":"; seen=0; line="sshd:x:22:22:server privilege separation,,,:/home/sshd:/sbin/nologin"; split(line, a) }
{ uids[$3] = $0 }
$1 == a[1] {
diff --git a/postinstall.rsfilter b/postinstall.rsfilter
@@ -8,4 +8,5 @@
+ /etc
+ /etc/group
+ /etc/passwd
++ /etc/passwd
+ /etc/shadow