0

I did a silly thing. I changed the permissions of my /etc folder using

sudo chmod -R ugo+rw /etc

After that I did some damage control using the command

pkexec chmod 755 /etc

Then I was able to the sudo commands but every time I use a sudo command a warning comes

sudo: /etc/sudoers.d is world writable

Is there a way to completely reset default permissions for /etc ?

1

1 Answer 1

0

Your system is in a very very bad state. Most people would suggest you to either reinstall or to boot into a live CD and then change the permissions of each and every file as it was before.

To get rid of your current error message, you need to change the permission of the /etc/sudoers.d/ directory to 755 and then changing the permissions of the contents of /etc/sudoers.d/ to 440:

sudo chmod 755 /etc/sudoers.d/
sudo chmod 440 /etc/sudoers.d/* 

If you have not already change the permission of /etc/sudoers too:

sudo chmod 440 /etc/sudoers

Not the answer you're looking for? Browse other questions tagged .