From ccf9d5046c9e82c0d8977604b0a04214b5e83fa1 Mon Sep 17 00:00:00 2001 From: velvettear Date: Wed, 27 Sep 2023 11:50:48 +0200 Subject: [PATCH] fixed adding user to group --- debian_install.sh | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/debian_install.sh b/debian_install.sh index 0dc9615..94a65e1 100755 --- a/debian_install.sh +++ b/debian_install.sh @@ -68,18 +68,18 @@ useradd -m -g users -s "/bin/zsh" "$user" printf "|> setting password for user '$user'...\n" echo -e "$password\n$password" | passwd "$user" -printf "|> adding user '$user' to group 'disk'...\n" && addgroup "$user" disk > /dev/null -printf "|> adding user '$user' to group 'lp'...\n" && addgroup "$user" lp > /dev/null -printf "|> adding user '$user' to group 'wheel'...\n" && addgroup "$user" wheel > /dev/null -printf "|> adding user '$user' to group 'floppy'...\n" && addgroup "$user" floppy > /dev/null -printf "|> adding user '$user' to group 'audio'...\n" && addgroup "$user" audio > /dev/null -printf "|> adding user '$user' to group 'cdrom'...\n" && addgroup "$user" cdrom > /dev/null -printf "|> adding user '$user' to group 'dialout'...\n" && addgroup "$user" dialout > /dev/null -printf "|> adding user '$user' to group 'tape'...\n" && addgroup "$user" tape > /dev/null -printf "|> adding user '$user' to group 'video'...\n" && addgroup "$user" video > /dev/null -printf "|> adding user '$user' to group 'netdev'...\n" && addgroup "$user" netdev > /dev/null -printf "|> adding user '$user' to group 'games'...\n" && addgroup "$user" games > /dev/null -printf "|> adding user '$user' to group 'sudo'...\n" && addgroup "$user" sudo > /dev/null +printf "|> adding user '$user' to group 'disk'...\n" && gpasswd -a "$user" disk > /dev/null +printf "|> adding user '$user' to group 'lp'...\n" && gpasswd -a "$user" lp > /dev/null +printf "|> adding user '$user' to group 'wheel'...\n" && gpasswd -a "$user" wheel > /dev/null +printf "|> adding user '$user' to group 'floppy'...\n" && gpasswd -a "$user" floppy > /dev/null +printf "|> adding user '$user' to group 'audio'...\n" && gpasswd -a "$user" audio > /dev/null +printf "|> adding user '$user' to group 'cdrom'...\n" && gpasswd -a "$user" cdrom > /dev/null +printf "|> adding user '$user' to group 'dialout'...\n" && gpasswd -a "$user" dialout > /dev/null +printf "|> adding user '$user' to group 'tape'...\n" && gpasswd -a "$user" tape > /dev/null +printf "|> adding user '$user' to group 'video'...\n" && gpasswd -a "$user" video > /dev/null +printf "|> adding user '$user' to group 'netdev'...\n" && gpasswd -a "$user" netdev > /dev/null +printf "|> adding user '$user' to group 'games'...\n" && gpasswd -a "$user" games > /dev/null +printf "|> adding user '$user' to group 'sudo'...\n" && gpasswd -a "$user" sudo > /dev/null printf "|> modifying sudoers...\n" sed -i "s/# %sudo ALL=(ALL) ALL/%sudo ALL=(ALL) ALL/" "/etc/sudoers"