$ -weight: 600;">sudo grep -nE '^[#@]includedir' /etc/sudoers
-weight: 600;">sudo grep -nE '^[#@]includedir' /etc/sudoers
-weight: 600;">sudo grep -nE '^[#@]includedir' /etc/sudoers
#includedir /etc/sudoers.d
#includedir /etc/sudoers.d
#includedir /etc/sudoers.d
cat >/tmp/90-app-maint <<'EOF'
Cmnd_Alias APP_MAINT = /usr/bin/-weight: 500;">systemctl -weight: 500;">restart myapp.-weight: 500;">service, /usr/bin/journalctl -u myapp.-weight: 500;">service -n 200
%deploy ALL=(root) APP_MAINT
EOF -weight: 600;">sudo /usr/sbin/visudo -cf /tmp/90-app-maint
cat >/tmp/90-app-maint <<'EOF'
Cmnd_Alias APP_MAINT = /usr/bin/-weight: 500;">systemctl -weight: 500;">restart myapp.-weight: 500;">service, /usr/bin/journalctl -u myapp.-weight: 500;">service -n 200
%deploy ALL=(root) APP_MAINT
EOF -weight: 600;">sudo /usr/sbin/visudo -cf /tmp/90-app-maint
cat >/tmp/90-app-maint <<'EOF'
Cmnd_Alias APP_MAINT = /usr/bin/-weight: 500;">systemctl -weight: 500;">restart myapp.-weight: 500;">service, /usr/bin/journalctl -u myapp.-weight: 500;">service -n 200
%deploy ALL=(root) APP_MAINT
EOF -weight: 600;">sudo /usr/sbin/visudo -cf /tmp/90-app-maint
/tmp/90-app-maint: parsed OK
/tmp/90-app-maint: parsed OK
/tmp/90-app-maint: parsed OK
-weight: 600;">sudo -weight: 500;">install -d -m 0755 /etc/sudoers.d -weight: 600;">sudo tee /etc/sudoers.d/90-app-maint >/dev/null <<'EOF'
Cmnd_Alias APP_MAINT = /usr/bin/-weight: 500;">systemctl -weight: 500;">restart myapp.-weight: 500;">service, /usr/bin/journalctl -u myapp.-weight: 500;">service -n 200
%deploy ALL=(root) APP_MAINT
EOF -weight: 600;">sudo chown root:root /etc/sudoers.d/90-app-maint
-weight: 600;">sudo chmod 0440 /etc/sudoers.d/90-app-maint
-weight: 600;">sudo /usr/sbin/visudo -cf /etc/sudoers.d/90-app-maint
-weight: 600;">sudo -weight: 500;">install -d -m 0755 /etc/sudoers.d -weight: 600;">sudo tee /etc/sudoers.d/90-app-maint >/dev/null <<'EOF'
Cmnd_Alias APP_MAINT = /usr/bin/-weight: 500;">systemctl -weight: 500;">restart myapp.-weight: 500;">service, /usr/bin/journalctl -u myapp.-weight: 500;">service -n 200
%deploy ALL=(root) APP_MAINT
EOF -weight: 600;">sudo chown root:root /etc/sudoers.d/90-app-maint
-weight: 600;">sudo chmod 0440 /etc/sudoers.d/90-app-maint
-weight: 600;">sudo /usr/sbin/visudo -cf /etc/sudoers.d/90-app-maint
-weight: 600;">sudo -weight: 500;">install -d -m 0755 /etc/sudoers.d -weight: 600;">sudo tee /etc/sudoers.d/90-app-maint >/dev/null <<'EOF'
Cmnd_Alias APP_MAINT = /usr/bin/-weight: 500;">systemctl -weight: 500;">restart myapp.-weight: 500;">service, /usr/bin/journalctl -u myapp.-weight: 500;">service -n 200
%deploy ALL=(root) APP_MAINT
EOF -weight: 600;">sudo chown root:root /etc/sudoers.d/90-app-maint
-weight: 600;">sudo chmod 0440 /etc/sudoers.d/90-app-maint
-weight: 600;">sudo /usr/sbin/visudo -cf /etc/sudoers.d/90-app-maint
-weight: 600;">sudo -l -U someuser
-weight: 600;">sudo -l -U someuser
-weight: 600;">sudo -l -U someuser
-weight: 600;">sudo tee /etc/sudoers.d/91--weight: 500;">apt-audit >/dev/null <<'EOF'
Cmnd_Alias APT_AUDIT = /usr/bin/-weight: 500;">apt -weight: 500;">update, /usr/bin/-weight: 500;">apt list --upgradable
%ops ALL=(root) APT_AUDIT
EOF -weight: 600;">sudo chown root:root /etc/sudoers.d/91--weight: 500;">apt-audit
-weight: 600;">sudo chmod 0440 /etc/sudoers.d/91--weight: 500;">apt-audit
-weight: 600;">sudo /usr/sbin/visudo -cf /etc/sudoers.d/91--weight: 500;">apt-audit
-weight: 600;">sudo tee /etc/sudoers.d/91--weight: 500;">apt-audit >/dev/null <<'EOF'
Cmnd_Alias APT_AUDIT = /usr/bin/-weight: 500;">apt -weight: 500;">update, /usr/bin/-weight: 500;">apt list --upgradable
%ops ALL=(root) APT_AUDIT
EOF -weight: 600;">sudo chown root:root /etc/sudoers.d/91--weight: 500;">apt-audit
-weight: 600;">sudo chmod 0440 /etc/sudoers.d/91--weight: 500;">apt-audit
-weight: 600;">sudo /usr/sbin/visudo -cf /etc/sudoers.d/91--weight: 500;">apt-audit
-weight: 600;">sudo tee /etc/sudoers.d/91--weight: 500;">apt-audit >/dev/null <<'EOF'
Cmnd_Alias APT_AUDIT = /usr/bin/-weight: 500;">apt -weight: 500;">update, /usr/bin/-weight: 500;">apt list --upgradable
%ops ALL=(root) APT_AUDIT
EOF -weight: 600;">sudo chown root:root /etc/sudoers.d/91--weight: 500;">apt-audit
-weight: 600;">sudo chmod 0440 /etc/sudoers.d/91--weight: 500;">apt-audit
-weight: 600;">sudo /usr/sbin/visudo -cf /etc/sudoers.d/91--weight: 500;">apt-audit
/etc/sudoers.d/90-app-maint
/etc/sudoers.d/90-app-maint
/etc/sudoers.d/90-app-maint
/etc/sudoers.d/90-app-maint.conf
/etc/sudoers.d/90-app-maint~
/etc/sudoers.d/90-app-maint.conf
/etc/sudoers.d/90-app-maint~
/etc/sudoers.d/90-app-maint.conf
/etc/sudoers.d/90-app-maint~
-weight: 600;">sudo chown root:root /etc/sudoers.d/90-app-maint
-weight: 600;">sudo chmod 0440 /etc/sudoers.d/90-app-maint
-weight: 600;">sudo chown root:root /etc/sudoers.d/90-app-maint
-weight: 600;">sudo chmod 0440 /etc/sudoers.d/90-app-maint
-weight: 600;">sudo chown root:root /etc/sudoers.d/90-app-maint
-weight: 600;">sudo chmod 0440 /etc/sudoers.d/90-app-maint
-weight: 600;">sudo /usr/sbin/visudo -c
-weight: 600;">sudo /usr/sbin/visudo -c
-weight: 600;">sudo /usr/sbin/visudo -c
tmp=$(mktemp)
cat >"$tmp" <<'EOF'
Cmnd_Alias APP_MAINT = /usr/bin/-weight: 500;">systemctl -weight: 500;">restart myapp.-weight: 500;">service, /usr/bin/journalctl -u myapp.-weight: 500;">service -n 200
%deploy ALL=(root) APP_MAINT
EOF -weight: 600;">sudo /usr/sbin/visudo -cf "$tmp"
-weight: 600;">sudo -weight: 500;">install -o root -g root -m 0440 "$tmp" /etc/sudoers.d/90-app-maint
-weight: 600;">sudo /usr/sbin/visudo -c
rm -f "$tmp"
tmp=$(mktemp)
cat >"$tmp" <<'EOF'
Cmnd_Alias APP_MAINT = /usr/bin/-weight: 500;">systemctl -weight: 500;">restart myapp.-weight: 500;">service, /usr/bin/journalctl -u myapp.-weight: 500;">service -n 200
%deploy ALL=(root) APP_MAINT
EOF -weight: 600;">sudo /usr/sbin/visudo -cf "$tmp"
-weight: 600;">sudo -weight: 500;">install -o root -g root -m 0440 "$tmp" /etc/sudoers.d/90-app-maint
-weight: 600;">sudo /usr/sbin/visudo -c
rm -f "$tmp"
tmp=$(mktemp)
cat >"$tmp" <<'EOF'
Cmnd_Alias APP_MAINT = /usr/bin/-weight: 500;">systemctl -weight: 500;">restart myapp.-weight: 500;">service, /usr/bin/journalctl -u myapp.-weight: 500;">service -n 200
%deploy ALL=(root) APP_MAINT
EOF -weight: 600;">sudo /usr/sbin/visudo -cf "$tmp"
-weight: 600;">sudo -weight: 500;">install -o root -g root -m 0440 "$tmp" /etc/sudoers.d/90-app-maint
-weight: 600;">sudo /usr/sbin/visudo -c
rm -f "$tmp"
-weight: 600;">sudo mv /etc/sudoers.d/90-app-maint /root/90-app-maint.disabled
-weight: 600;">sudo /usr/sbin/visudo -c
-weight: 600;">sudo mv /etc/sudoers.d/90-app-maint /root/90-app-maint.disabled
-weight: 600;">sudo /usr/sbin/visudo -c
-weight: 600;">sudo mv /etc/sudoers.d/90-app-maint /root/90-app-maint.disabled
-weight: 600;">sudo /usr/sbin/visudo -c - keep the base /etc/sudoers file package-friendly
- separate app- or team-specific privileges into small files
- validate one candidate rule before installing it
- manage delegated access with configuration management more cleanly - -c or --check for validation
- -f or --file for an alternate file path - defines a command alias named APP_MAINT
- allows members of the deploy group to run those commands as root
- keeps the permission scope narrow and explicit - syntax is checked before -weight: 500;">install
- final permissions are enforced during -weight: 500;">install
- the complete active policy is checked afterward - editing /etc/sudoers directly for every small exception
- granting ALL=(ALL:ALL) ALL to convenience groups
- using wildcards loosely around commands with shell escapes or user-controlled arguments
- storing drop-ins with .conf, .bak, or editor backup suffixes
- skipping a full visudo -c after policy changes - sudoers manual: https://www.-weight: 600;">sudo.ws/docs/man/sudoers.man/
- visudo manual: https://www.-weight: 600;">sudo.ws/docs/man/visudo.man/
- Debian -weight: 600;">sudo package metadata: https://packages.debian.org/search?keywords=-weight: 600;">sudo