How to fix ownership of /etc folder

Means you mistakenly chowned your /etc folder on cPanel server

chown root: /etc

find /etc -user USERNAME -exec chown root {} \;
find /etc -group USERNAME -exec chown .root {} \;

chown named: /etc/named.conf
chown root.named /etc/named/

find /etc -maxdepth 1 -type l -exec chown -h root.root {} \;
find /etc -type l -user USERNAME -exec chown -h root.root {} \;

chown mailnull.mail /var/cpanel/ssl/exim/myexim.crt
chown mailnull.mail /var/cpanel/ssl/exim/myexim.key

chown root.ssh_keys /etc/ssh/ssh_host_rsa_key
chown root.ssh_keys /etc/ssh/ssh_host_ed25519_key
chown root.ssh_keys /etc/ssh/ssh_host_ecdsa_key

for i in `\ls /etc/valiases`; do owner=`/scripts/whoowns $i`; chown $owner.mail /etc/valiases/$i; done
for i in `\ls /etc/vdomainaliases`; do owner=`/scripts/whoowns $i`; chown $owner.mail /etc/vdomainaliases/$i; done
for i in `\ls /etc/vfilters`; do owner=`/scripts/whoowns $i`; chown $owner.mail /etc/vfilters/$i; done

Similar Posts:

    None Found

Leave a Reply

Your email address will not be published. Required fields are marked *