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.

Chmod Permissions Revert Problem

Discussion in 'General Discussion' started by searcher1, Sep 14, 2008.

  1. searcher1

    searcher1 Active Member

    Joined:
    Jul 23, 2005
    Messages:
    26
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    London, UK
    Okay,
    I'm guessing something very simple which I've overlooked.
    Basically just redoing some script permissions (after the script updated with permission errors).

    Example: Chmod a child directory to 666 which is currently 766 (the parent is 777). What happens is I chmod it to 666 but it reverts back to 766. :confused:

    Some simple answer?
    Michael
     
  2. brianoz

    brianoz Well-Known Member

    Joined:
    Mar 13, 2004
    Messages:
    1,146
    Likes Received:
    6
    Trophy Points:
    38
    Location:
    Melbourne, Australia
    cPanel Access Level:
    Root Administrator
    Simple answer is: don't do that! :)

    A 666 permission on a directory isn't valid; you always need to allow execute ('x') permission.

    So, for a directory you probably want mode 777. However, I need to warn you that if you have to change permissions like that your web server is really insecure.

    Cheers!
     
  3. searcher1

    searcher1 Active Member

    Joined:
    Jul 23, 2005
    Messages:
    26
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    London, UK
    Thank you for that .... But I should have said 'file (NOT directory) to 666'.
    Michael
     
  4. brianoz

    brianoz Well-Known Member

    Joined:
    Mar 13, 2004
    Messages:
    1,146
    Likes Received:
    6
    Trophy Points:
    38
    Location:
    Melbourne, Australia
    cPanel Access Level:
    Root Administrator
    So you are trying to chmod a file to 666 and it's reverting to 766? Are you sure?

    There should be no problem with "chmod 666 file", unless there's some other factor involved.

    Again this falls into the category of things you don't want to do (even if you think you do!). If you have to set permissions like this your security on your webserver is so bad you should consider moving hosts, as anything in your PHP files or databases will be readable to anyone else on the server. Really, I'm not making this up.
     
  5. searcher1

    searcher1 Active Member

    Joined:
    Jul 23, 2005
    Messages:
    26
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    London, UK

    Well it's just a language file actually. Yes I'm sure it reverts back to 766 and I want it to be 666. Obviously some other factor involved. I have full access to my server to do any adjustments.
    Michael
     
  6. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,461
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Where is this file located on the server?
     
  7. searcher1

    searcher1 Active Member

    Joined:
    Jul 23, 2005
    Messages:
    26
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    London, UK
    It's within a directory (as in it's itself a language file). It was a mere script update (within a huge php gallery script) that flagged it as a single file which needed to be changed. I tried to change it to 666 (as it was 766 for some reason) and it simply kept reverting back.
    Michael
     
  8. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,461
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    So the file is within a user directory, not within a system directory?

    Have you checked cron jobs owned by the root user and the account user?

    It sounds silly, but after you execute chmod, have you verified the permissions were actually changed?
     
  9. searcher1

    searcher1 Active Member

    Joined:
    Jul 23, 2005
    Messages:
    26
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    London, UK
    Correct, within a user directory.
    No account user cron jobs
    I did check and they merely reverted back (plus the ftp prog flagged up a 550 error with unable to change)

    Michael
     
  10. brianoz

    brianoz Well-Known Member

    Joined:
    Mar 13, 2004
    Messages:
    1,146
    Likes Received:
    6
    Trophy Points:
    38
    Location:
    Melbourne, Australia
    cPanel Access Level:
    Root Administrator
    OK - from that new piece of information (550 unable to change), it sounds like the permissions are actually not changing when you attempt to change them from ftp.

    This is probably because you don't own the file in question.

    If you have write access to the directory containing the file, you can rename the file (eg to file.notme) and then copy it back to the original file, you'll then own it and be able to change permissions.

    If you own the server, you're better off running suphp so you don't need to do insecure permission changes.
     
    #10 brianoz, Sep 16, 2008
    Last edited: Sep 16, 2008
  11. searcher1

    searcher1 Active Member

    Joined:
    Jul 23, 2005
    Messages:
    26
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    London, UK
    Thank you for the replies - now working :) :D
    Apologies for the initial confusion on my part. :eek:
    Michael
     
  12. brianoz

    brianoz Well-Known Member

    Joined:
    Mar 13, 2004
    Messages:
    1,146
    Likes Received:
    6
    Trophy Points:
    38
    Location:
    Melbourne, Australia
    cPanel Access Level:
    Root Administrator
    Our pleasure, and don't worry, we were all there ourselves once so we understand!
     
Loading...

Share This Page