From 3544cf1c3037f6fbfce5dff8bdb1ccae1ab4ffb3 Mon Sep 17 00:00:00 2001 From: Steev Klimaszewski Date: Thu, 18 Mar 2021 10:58:15 -0500 Subject: [PATCH] kali-finish-install: Add kali user to dialout group This does away with the kaboxer specific setup that was just adding the kali user to the kaboxer group. And make it a bit easier to add the user to multiple groups if we decide we want to add them to more in the future. --- bin/kali-finish-install | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/bin/kali-finish-install b/bin/kali-finish-install index 462ba03..0babf39 100755 --- a/bin/kali-finish-install +++ b/bin/kali-finish-install @@ -51,17 +51,21 @@ configure_zsh() { done } -configure_kaboxer() { - # Create the group if needed - addgroup --system kaboxer || true +# This is generically named in case we want to add other groups in the future. +configure_usergroups() { + # Create the kaboxer group if needed + addgroup --system kaboxer || true - # Add the users to the group - for user in $(get_user_list); do - echo "INFO: adding user '$user' to group 'kaboxer'" - adduser $user kaboxer || true - done + # kaboxer - for kaboxer + # dialout - for serial access + kali_groups="kaboxer,dialout" + + for user in $(get_user_list); do + echo "INFO: adding user '$user' to groups '$kali_groups'" + usermod -a -G "$kali_groups" $user || true + done } configure_sources_list configure_zsh -configure_kaboxer +configure_usergroups