sudo: /etc/sudo.conf is group writable

I’ve made a mistake. List of commands that I typed:

  • sudo usermod -a -G root erp
  • sudo chmod g+w /etc
  • setfacl -R -m u:erp:rwx /etc

Then ssh.service of the virtual machine stopped working and when I type commands with sudo in terminal, it says sudo: /etc/sudo.conf is group writable.

And after googling for some time, it seems what I have done is similar to chmod -R 777 /. I’m hoping that I don’t need to reinstall the Ubuntu OS on this machine. Is what I have done actually revertible?

Asked By: dip chit

||

You have enabled a recursive ACL on the entire /etc directory. Run this to remove all ACLs recursively:

setfacl -b -R /etc

If you are still getting the error, post the output of ls -alh /etc/sudo.conf, if it has group write you can probably remove it with chmod g-w.

In the future, do not run commands that you don’t understand. Use something like https://explainshell.com/ or read man pages.

Answered By: pzkpfw