From 18a8012e476a1e4074a63e35efab62fc66029f3a Mon Sep 17 00:00:00 2001 From: Pratik Tripathy <> Date: Mon, 13 Oct 2025 12:08:00 +0530 Subject: [PATCH] fix(sudo): For wheel group as sudoer, check and creates the sudoers directory & file --- init-linux-harden.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/init-linux-harden.sh b/init-linux-harden.sh index 10eafdb..fe9ce2f 100755 --- a/init-linux-harden.sh +++ b/init-linux-harden.sh @@ -335,6 +335,13 @@ user_privileged_access() { command_status=$? fi + if [ ! -d "$SUDOERS_DIR" ]; then + mkdir -p "$SUDOERS_DIR" >/dev/null + fi + + if [ ! -f "$SUDOERS_DIR"/wheel ]; then + touch "$SUDOERS_DIR"/wheel >/dev/null + fi echo "%wheel ALL=(ALL) ALL" >"$SUDOERS_DIR"/wheel elif getent group sudo >/dev/null 2>&1; then # Debian, Ubuntu output=$(usermod -aG sudo "$USERNAME" 2>&1)