Permissions of /etc directory messed up

avergara08

Registered
Dec 6, 2012
4
0
1
cPanel Access Level
Root Administrator
TL;DR - How can I restore the original file and folder permissions of /etc

-------------------------------------------------------------------------------------

I was trying to create a separate ssh account for another coder so that he will not be able to access everything if I give him the root account.

While I was testing the newly created account, i discovered he can access /etc folder and I was like "no".

Without any sane thinking, i immediately ran
Code:
chmod o-r -R
and
Code:
chmod g-r -R
:eek:

This apparently caused a lot of errors (ssh, website access, cpanel access, git, etc), and I was so f*cked up.

To make things worse, I panicked and ran
Code:
chmod o+r -R
and
Code:
chmod g+r -R
hoping to make things better :( (god i am so @!#!, sorry guys)

I managed to fix a few things, such as ssh, git, and our websites run properly now.. But I am now having problems with drush - outputting a "segmentation fault" error. This was not happening before.

I am sure there are alot of other things unknown to me that are probably having problems as well. So I think the best way is to restore the original file and folder permissions of /etc . Is there a way to do this?

:(
 

JaredR.

Well-Known Member
Feb 25, 2010
1,834
24
143
Houston, TX
cPanel Access Level
Root Administrator
The only things you can really do are compare the permissions of files and directories in /etc on a known-working server, or run a bash loop command to use rpm -V to verify every package that is installed on the server, and reinstall every package that has discrepancies on its files in /etc. The latter will not necessarily get everything, though, since some files in /etc are not owned by any package.