How to fix this sudo: /etc/sudoers is world writable?

Vikas Saini picture Vikas Saini · Feb 5, 2016 · Viewed 12.4k times · Source

I am working on AWS EC2 machine. File permission of sudores file is,

-rwxrwxrwx 1 root root 902 Feb 5 12:22 sudoers

There are various question on this , but these not works. When i am trying to do,

sudo chmod 444 sudoers

This show error,

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

How to fix it ?

Answer

VinoCoder picture VinoCoder · Nov 29, 2017

Just run this 2 commands in terminal:

pkexec chmod 555 /etc/sudoers
pkexec chmod 555 /etc/sudoers.d/README