Step 1: Create New File in /etc/sudoers.d/
sudo visudo -f /etc/sudoers.d/custom-rulesStep 2: Add Rules
# Allow user to run apt commands without password
username ALL=(ALL) NOPASSWD: /usr/bin/apt update, /usr/bin/apt upgrade
# Allow group to run as www-data
%webteam ALL=(www-data) ALLStep 3: Set Proper Permissions
sudo chmod 440 /etc/sudoers.d/custom-rulesStep 4: Validate Syntax
sudo visudo -cStep 5: Test
sudo -k
sudo apt update