“sudo: /etc/sudoers is world writable” – How to correct the permissions of sudoers file

Question: How to correct /etc/sudoers file permission (e.g. of issue found).

$ sudo syscheck
sudo: /etc/sudoers is world writable
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin

You may encounters error as shown above if the sudoers file permissions are incorrect. Follow the steps below to correct the permissions.

1. Verify that sudoers file permission is correct:

# ls -l /etc/sudoers

2. The expected output:

-r--r-----. 1 root root 3822 Sep 12 08:53 /etc/sudoers

3. Changed the file permission if needed as root:

# chmod 440 /etc/sudoers

4. If step 2 is performed, verify the change that was made:

# ls -l /etc/sudoers
Related Post