Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Ownership of /home/user/public_html

Discussion in 'General Discussion' started by webignition, Mar 16, 2005.

  1. webignition

    webignition Well-Known Member

    Jan 22, 2005
    Likes Received:
    Trophy Points:
    I've recently started moving a fair amount of files from one Cpanel account to another - one account runs a development copy of a site and the other the public live version, with changes applied to the development version first and then moved to the live version.

    I've come to realise that every public_html directory is owned by user:nobody, in contrast to most of the files within a given public_html directory which will (hopefully) be owned by user:user.

    When moving a batch of files from /home/userdev to /home/user, the files in /home/user end up, quite understandably, being owned by the user that moved the files - root:root and so need to be chowned accordingly.

    chown -R user:user /home/user/public_html/
    chown user:nobody /home/user/public_html/
    My question (took a while getting there) - why does the public_html directory for a given account have to be owned by user:nobody instead of just user:user? If I left the ownership of a public_html directory as user:user instead of user:nobody, would it cause any problems?
  2. chirpy

    chirpy Well-Known Member

    Jun 15, 2002
    Likes Received:
    Trophy Points:
    Go on, have a guess
    Yes. It needs to be owned by user:nobody so that apache can read the files therein (apache runs as nobody unless it's running an SUEXEC per CGI script or a PHPSUEXEC php script). This is because the public_html directories should also be chmod 750 - i.e. no world read/write, so apache needs to access through the group permission (5) using the nobody group.

Share This Page