From d126cdde429b4abf5ea0c966d2cb28f349b43af1 Mon Sep 17 00:00:00 2001 From: user1 Date: Thu, 6 Apr 2023 15:44:36 +0200 Subject: [PATCH] use private groups for the primary groups of the user --- arch-graphical-install-auto.sh | 8 ++++---- arch-install.sh | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/arch-graphical-install-auto.sh b/arch-graphical-install-auto.sh index f62dc6e..89c4bbe 100755 --- a/arch-graphical-install-auto.sh +++ b/arch-graphical-install-auto.sh @@ -107,7 +107,7 @@ function standartinstallation() { function addusers() { # Erstelle Gruppen groupid=1000 - for wort in master users wheel audio input power storage video sys optical adm lp scanner sddm kvm fuse autologin network wireshark docker libvirt libvirtdbus; do + for wort in users wheel audio input power storage video sys optical adm lp scanner sddm kvm fuse autologin network wireshark docker libvirt libvirtdbus; do if ! cat /etc/group | grep ${wort}; then while cat /etc/group | grep ${groupid}; do groupid=$((${groupid} + 1)) @@ -121,7 +121,7 @@ function addusers() { useruid=$((${useruid} + 1)) done - useradd -m -g master -G users,wheel,audio,input,power,storage,video,sys,optical,adm,lp,scanner,sddm,kvm,fuse,autologin,network,wireshark,docker,libvirt,libvirtdbus -s /usr/bin/zsh --uid ${useruid} ${user} + useradd -m -G users,wheel,audio,input,power,storage,video,sys,optical,adm,lp,scanner,sddm,kvm,fuse,autologin,network,wireshark,docker,libvirt,libvirtdbus -s /usr/bin/zsh --uid ${useruid} ${user} echo "${user}:${userpass}" | chpasswd mkdir -p /home/${user}/ userrechte @@ -296,8 +296,8 @@ echo "%wheel ALL=(ALL) NOPASSWD: ALL" >> $SUDOERS echo "%master ALL=(ALL) NOPASSWD: ALL" >> $SUDOERS # Setze die die UIDs und GIDs standartmässig auf 2000 bei der erstellung von neuen Benutzern und Gruppen -sed -i 's/^UID_MIN.*$/UID_MIN 2000/' /etc/login.defs -sed -i 's/^GID_MIN.*$/GID_MIN 2000/' /etc/login.defs +#sed -i 's/^UID_MIN.*$/UID_MIN 2000/' /etc/login.defs +#sed -i 's/^GID_MIN.*$/GID_MIN 2000/' /etc/login.defs # systemaktualisierung diff --git a/arch-install.sh b/arch-install.sh index f4d1fd9..dde0479 100755 --- a/arch-install.sh +++ b/arch-install.sh @@ -1570,6 +1570,7 @@ fi # Nur nötig wenn der Name gleich dem Usernamen gleichen soll arch-chroot ${mountpoint} usermod -l "${user}" "user1" +arch-chroot ${mountpoint} groupmod -n "${user}" "user1" arch-chroot ${mountpoint} usermod -d /home/"${user}" -m "${user}" arch-chroot ${mountpoint} chfn -f "${name}" "${user}" arch-chroot ${mountpoint} chsh -s /usr/bin/zsh ${user}