Default files and folders permission/ownership in a cPanel account

You must have this basic knowledge, if you have to manage a cPanel account. All files and folders under a cPanel account have predefined permission and ownership. If any changes on this permission and ownership, it may cause the website to stop normal functioning. cPanel/WHM is one of the most popular control panel in webhosting industry. We already discussed a lot of topics related on the control panel cPanel. The installation of cPanel is also an easy process. You can refer this link to install cPanel in your CentOS server, cPanel installation guide

Here I’m listing the default permission and ownership of important files and folders in a cPanel account (This includes information for a cPanel account).

1. Default document root;

The document root is located under the /home/&user directory by default.

public_html: A subdirectory, located inside your home directory, that contains files that are publicly accessible via HTTP. The www directory is a link to public_html. Any files and folders inside of public_html are visible over the Internet, unless you specifically protect them with password protection or using the .htaccess file.

# ll -d /home/crybit/public_html/
drwxr-x--- 51 crybit nobody 4096 Jan  9 10:23 /home/crybit/public_html/

Folder permission : 750
Folder ownership : $user : nobody

2, Home directory itself;

# ll -d /home/crybit/
drwx--x--x 29 crybit crybit 4096 Jan  9 08:04 /home/crybit/

Folder permission : 711
Folder ownership : $user : $user

3, FTP folder;

public_ftp: A subdirectory, located inside your home directory, that contains files that are publicly accessible via FTP. FTP users may also upload files to this directory.
This is the default directory users will access when they connect to your site via anonymous FTP.

# ll -d /home/crybit/public_ftp/
drwxr-xr-x 3 crybit crybit 4096 Jan 11  2008 /home/crybit/public_ftp/

Folder permission : 755
Folder ownership : $user : $user

4, Tmp folder;

Which contains the following sub directories “analog, awstats, webalizer etc”.

# ll -d /home/crybit/tmp
drwxr-xr-x 8 crybit crybit 4096 Jan  9 10:55 /home/crybit/tmp

Folder permission : 755
Folder ownership : $user : $user

5, The mail folder;

Which contains the email accounts details. Important sub directories are “cur, new and tmp”.

# ll -d /home/crybit/mail
drwxr-x--x 11 crybit crybit 4096 Jul 23  2014 /home/crybit/mail/

Folder permission : 751
Folder ownership : $user : $user

6, The etc directory;

Which contains password informations.

# ll -d /home/crybit/etc
drwxr-x--- 3 crybit mail 4096 Feb 21 12:56 /home/crybit/etc/

Folder permission : 750
Folder ownership : $user : mail

7, access-logs;

This folder is actually a link to domlog folder. Which contains access log informations.

# ll -d access-logs/
drwxr-x--- 2 root crybit 4096 Feb 21 07:00 access-logs/

lrwxrwxrwx 1 crybit crybit 31 Aug 6 2014 access-logs -> /usr/local/apache/domlogs/crybit/

Folder permission : 750
Folder ownership : root : $user

Will include more….

Also read

1, AWStats not updating automatically – cPanel
2, Get Softaculous license details from commandline
3, How to restart the service Spamd – cPanel
4, How to change main domain of a cPanel reseller account with an existing domain name?

Arunlal Ashok

Linux Server Administrator. I'm dealing with Linux servers since 2012. I started this blog to share and discuss my ideas with the world. Check My Profile!! in uPwork (oDesk) and let me know if you need any assistance. Thanks!!

You may also like...

Leave a Reply

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