From e0d142fc06df4a4d051dfbb622f54da4de3aa80c Mon Sep 17 00:00:00 2001 From: jeanGaston Date: Wed, 31 Jan 2024 11:39:56 +0100 Subject: [PATCH] Update ad-join-script.sh Add the support for AD group in sudoer file --- ad-join-script.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ad-join-script.sh b/ad-join-script.sh index 5753a95..746f853 100644 --- a/ad-join-script.sh +++ b/ad-join-script.sh @@ -9,6 +9,7 @@ read -p "Administrator username (AdminUser): " admin_user read -s -p "Administrator password: " admin_password echo # To move to the next line read -p "Active Directory domain name: " domain_name +read -p "Active Directory group for sudo access: " ad_group # Prompt for DNS server IP and verify DNS resolution while true; do @@ -54,6 +55,8 @@ systemctl restart sssd # Add the user to the sudoers file echo "Adding the user to the sudoers file..." echo "$admin_user ALL=(ALL:ALL) ALL" | sudo tee -a /etc/sudoers +echo "Adding the group to the sudoers file..." +echo "%$ad_group ALL=(ALL:ALL) ALL" | sudo tee -a /etc/sudoers # Verify successful domain join by looking up the user echo "Verifying domain join..."