PDA

View Full Version : sudo.d problem



fred2028
August 19th, 2010, 04:45 PM
I accidentally chmod-ed everything in /etc to 777 and broke sudo. I booted into recovery mode and chmod-ed /etc/sudoers to 0440 and /etc/sudoers.d/ to 0440 also. But now when I try sudo it says

sudo: can't open /etc/sudoers.d/README: Permission denied
If I change it to 777 it complains that it's not 0440. If I change it to 0440 I get the above error. How do I fix this?

Lars Noodén
August 23rd, 2010, 07:12 PM
Do you mean sudoers.d instead?

chown -R root:root /etc/sudoers.d
chmod u=rwx,g=rx,o=rx /etc/sudoers.d/
chmod u=r,g=r,o= /etc/sudoers.d/*

The files should be read only for the user root and the group root, nothing more for anyone. The directory must be r x for everyone and for the group root, but only the user root gets write permission to the directory.

SilentThunderStorm
October 15th, 2011, 07:46 PM
WOOT!

Just necro-bumped to say thank you.

I had been getting irritated with having to chmod a million files while trying to fix an Apache issue, and used chmod -R 7777 /etc...

Obviously, unwise.

You just saved me from a lifetime of pain for that decision, though.

Thank you again.

drvik
December 31st, 2011, 06:25 PM
Do you mean sudoers.d instead?

chown -R root:root /etc/sudoers.d
chmod u=rwx,g=rx,o=rx /etc/sudoers.d/
chmod u=r,g=r,o= /etc/sudoers.d/*

The files should be read only for the user root and the group root, nothing more for anyone. The directory must be r x for everyone and for the group root, but only the user root gets write permission to the directory.

Just wanted to say a big thank you Lars for helping me to fix this problem after an hour of trying to do so myself...!!:popcorn:

cptahab313
July 14th, 2012, 12:19 AM
Fantastique! May the gods of strength bless you and your rainbow inspired third army! Woo Woo!!

^^ Doesn't make much sense, but it doesn't have to, the point is that I am happy that this fix worked PERFECTLY!!

Wild Man
July 14th, 2012, 09:12 PM
Old thread closed.