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

sudo: /etc/sudoers is world writable mac
sudo: no valid sudoers sources found, quitting
pkexec command not found
chmod: changing permissions of '/etc/sudoers': operation not permitted
fix etc/sudoers
authentication is needed to run `/bin/chmod' as the super user
pkexec chmod 0440 /etc/sudoers
pkexec chown root root etc/sudoers etc/sudoers d

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 ?

It's complicated and discussed here

https://forums.aws.amazon.com/thread.jspa?messageID=284712

Basically you detach the EBS volume from the EC2, mount it on another EC2, use root privs on that host to fix the file and then reattach it to the EC2

How to solve "sudo: /etc/sudoers.d is world writable", Run pkexec chmod 0755 /etc/sudoers.d. pkexec will use a different method of using root permissions, bypassing the issue. And the chmod will  $ sudo syscheck sudo: /etc/sudoers is world writable sudo: no valid sudoers sources found, quitting sudo: unable to initialize policy plugin Follow the steps below to correct the permissions. 1.

Just run this 2 commands in terminal:

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

Fixing the 'sudo: /etc/sudoers.d is world writable' problem, Fixing the 'sudo: /etc/sudoers.d is world writable' problem. Posted on June 16, 2016. I've just helped a colleague with a problem (beyond the mental one), when​  The sudoers file must not be world writable. If a file is world writable, everyone can write to the file. If a file is world writable, everyone can write to the file. By default, the file mode for the sudoers file is 0440 .

pkexec chmod 0440 /etc/sudoers 

How to fix this sudo: /etc/sudoers is world writable?, It's complicated and discussed here. https://forums.aws.amazon.com/thread.jspa?​messageID=284712. Basically you detach the EBS volume  -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 ?

How to solve "sudo: /etc/sudoers.d is world writable"? (3 Solutions , How to solve "sudo: /etc/sudoers.d is world writable"? (3 Solutions!) Helpful? Please Duration: 2:30 Posted: Aug 22, 2019 From the limited details in the OP, my guess is malware. /etc/sudoers is never going to be made world-writable by accident, so if you executed that cracked software with root privileges it probably pwned your machine and tried to add itself to the sudoers file in a sloppy way.

How to restore to permissions to sudoers file with no password , and i can't change it back to 440, becuse i need to be root to do it and i can't do "​sudo". I read somewhere the solution is to run pkexec chmod 0440 /etc/sudoers. sudo: /etc/sudoers is world writable sudo: no valid sudoers sources found, quitting sudo: unable to initialize policy plugin and i can't change it back to 440, becuse i need to be root to do it and i can't do "sudo". I read somewhere the solution is to run. pkexec chmod 0440 /etc/sudoers

sudo: /etc/sudoers is world writable, sudo: /etc/sudoers is world writable. Thread: sudo: And also I tried installing as root user (su -), but still I'm facing the same problem. The easiest way to fix this is from within a live system. Boot the machine from a live usb stick and fix the sudoers file. Then boot normally and you should be able to use sudo again. joe_2000

Comments
  • Code and commands are always handy, but some comments/context helps too. For example, why 0440?