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.

Immutable www directory

Discussion in 'Security' started by whm-expert, Apr 12, 2013.

  1. whm-expert

    whm-expert Active Member

    Joined:
    Nov 10, 2012
    Messages:
    40
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    DataCenter Provider
    Hello All

    i want to immutable "www" directory for a website in my server except "www/ar/upload" so no one can change the file from FTP,or file manger in cpanel
    so if

    i "chattr -R +i /home/User/www"

    then i

    "chattr -R -i /home/User/www/ar/upload"

    could the user still upload file to "upload" directory?and is this the right way to do it?

    Best regards
     
  2. ThinIce

    ThinIce Well-Known Member

    Joined:
    Apr 27, 2006
    Messages:
    346
    Likes Received:
    7
    Trophy Points:
    18
    Location:
    Disillusioned in England
    cPanel Access Level:
    Root Administrator
    hrm, you might want to try this on the public_html directory rather than with www (which I think will be a symlink in a cPanel environment by default) I've got a feeling there is an additional flag necessary if you want chattr to follow links, although if that's your problem I'm surprised it isn't throwing an error
     
  3. whm-expert

    whm-expert Active Member

    Joined:
    Nov 10, 2012
    Messages:
    40
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    DataCenter Provider
    if i "Immutable" www directory, except only folder named "upload",
    is this will effect one backup?
     
  4. quizknows

    quizknows Well-Known Member

    Joined:
    Oct 20, 2009
    Messages:
    942
    Likes Received:
    57
    Trophy Points:
    28
    cPanel Access Level:
    DataCenter Provider
    You probably cannot do this this way. If the parent directory is immutable, none of it's contents can be changed regardless of attributes. For example if public_html (www) is immutable, you could not make any changes to public_html/upload/ at all because upload is inside of an immutable directory. Instead, you'd have to cd into public_html, and make everything immutable except upload, but then a user could probably make a new folder in public_html.
     
Loading...

Share This Page