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.

/scripts/chownpublichtmls

Discussion in 'General Discussion' started by sist32, Oct 28, 2008.

  1. sist32

    sist32 Member

    Joined:
    Sep 25, 2007
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    /scripts/chownpublichtmls change chown only folders and fails in public_html or and folder public_html? Folders public_html is chmod 750 and chown username:nobody , change chown username:username for folders public_html = error 404

    suPHP
     
  2. cpanelinfoseeker

    cpanelinfoseeker Well-Known Member

    Joined:
    Oct 25, 2002
    Messages:
    325
    Likes Received:
    3
    Trophy Points:
    18
    Location:
    NE Illinois
    cPanel Access Level:
    Root Administrator
    public_html defaults to "username:nobody" with 750 being correct also.

    Your settings would be correct for the files in(under) public_html, just not for the folder named "public_html".

    Works this way on my server.
    Ron
     
  3. netarus

    netarus Well-Known Member

    Joined:
    Oct 27, 2002
    Messages:
    105
    Likes Received:
    0
    Trophy Points:
    16
    Hi All,

    This script is very useful, but is there a way to have a user's uploaded files through the web interface to be owned by the user instead of nobody by default?

    AND

    Is there a way for the files that are uploaded by nobody to calculate into their quotas?
     
  4. sist32

    sist32 Member

    Joined:
    Sep 25, 2007
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Yes, now is public_html defaults to "username:nobody" with 750
    And after /scripts/chownpublichtmls public_html is "username:nobody" ? But all fail and folder in public_html "username:username"?

    Thanks
     
  5. nitro777

    nitro777 Registered

    Joined:
    Apr 6, 2008
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Hello ,

    Try chown -R userid:groupid /home/userdir

    Thank you .
     
  6. stdout

    stdout Well-Known Member

    Joined:
    Apr 10, 2003
    Messages:
    189
    Likes Received:
    5
    Trophy Points:
    18
    Location:
    Nelspruit, Mpumalanga, South Africa
    cPanel Access Level:
    Root Administrator
    Generate the script:
    Code:
    cd /var/cpanel/users; ls -1 | awk {'print "chown "$1":nobody /home/"$1"/public_html"'} > ~/fixpubhtmlownerships.sh
    Run the generated script:
    Code:
    sh ~/fixpubhtmlownerships.sh
    It would be wise to remove the first 2 lines in ~/fixpubhtmlownerships.sh prior to running it, but there's no harm though - just good practice :)
     
  7. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,461
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    One way is to use suPHP as all scripts will then run as the account owner rather than 'nobody'
     
    #7 cPanelKenneth, Nov 28, 2008
    Last edited: Nov 28, 2008
Loading...

Share This Page