Interview Prep/Linux/Permissions, ownership, SELinux and mounts

`sudo` prints `sudo: /etc/sudoers.d/ops is world writable` and then fails.

IntermediateTroubleshootingPermissions, ownership, SELinux and mounts
Answer

Likely causes → A sudoers include file has unsafe permissions or ownership, so sudo refuses it.

Diagnose →

ls -l /etc/sudoers /etc/sudoers.d/

Fix → As root (via pkexec, console, or another working sudo rule): chmod 0440 /etc/sudoers.d/ops && chown root:root /etc/sudoers.d/ops. Check syntax with visudo -c.

Prevent → Deploy sudoers files with validate: visudo -cf %s and mode: 0440 in Ansible.

All Linux questions Roadmap: Linux

More on Permissions, ownership, SELinux and mounts