Default Permission & Ownership Values
Is there a list of permissions & ownership of important files and folders in cPanel so that when we delete or change something we can get it back to required values?
I'm going to number a few that I need this info for:
- Root folders of domains and subdomains, including the main domain's public_html folder. I see these are owned by user nobody.
- .htaccess and HTML files in websites.
- Include files and folders in /etc/apache2/conf.d/userdata
- Config files in /etc/apache2/conf.d/modsec
I need both permission and ownership info for these.
Is there a general rule we can follow when we're not sure what to set? For example, is there a reason to allow group and public access for certain files?
-
Hey hey! I'm not aware of any published list. When I need to reference something in particular, I just create a new test account and look there.
For system files, I'm always happy to answer those:
1 - /home/username is always user:user 711. public_html is usually user:user 755 unless you have fileprotect enabled: https://docs.cpanel.net/ea4/apache/the-easyapache-4-fileprotect-option/
2 - All files should be 644 and directories 755 by default
3 - Includes are always 600 root:root
4 - /etc/apache2/conf.d/modsec is root:root 755
1 -
Hey! Thank you. But what about the ownership of public_html and other domain's public roots? For me, it's user nobody, is that OK? My cPanel is creating them like this, I checked.
What values are for include folders?
0 -
that should be fine. There is a cool script with which you can use to mass restore default permissions on folders inside accounts:
https://github.com/PeachFlame/cPanel-fixperms
Andrew N. - cPanel Plesk VMWare Certified Professional
Do you need immediate assistance? 20 minutes response time!*
EmergencySupport - Professional Server Management and One-time Services1 -
Thanks! That script looks cool but it only services user folders.
What about these two:
- /etc/apache2/conf.d/modsec/modsec2.user.conf
- folders inside /etc/apache2/conf.d/userdata
0 -
1 - 600
2 - all of these are 7551 -
Thank you! I had some folders in /etc/apache2/conf.d/userdata with 700.
0
Please sign in to leave a comment.
Comments
6 comments