0

I cannot execute any command using sudo. I get this error:

pi@raspberrypi:~ $ sudo apt-get update
sudo: /etc/sudoers is world writable
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin
pi@raspberrypi:~ $

It does not matter what command I try to execute using sudo, I always get the same error.

0

This is what happens when the permissions on /etc get messed up. There is a forum post which shows methods to fix this:

  • Restore from your latest backup

  • Re-image the SD card and start again

  • Add "init=/bin/sh" to the end of cmdline.txt to get a root recovery shell, mount the "/" partition and try and fix the permissions. Most of them should be 644 (-rw-r--r--) for files and 755 (drwxr-xr-x) for directories with owner root:root, but there are a few that are more restrictive. /etc/sudoers and anything under /etc/sudoers.d should be 640 (-rw-r-----). That is probably very important. The /etc/sudoers.d directory itself is 755 like all the other directories.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.