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.

Reset default permissions

Discussion in 'General Discussion' started by syshackmin, Jan 24, 2004.

  1. syshackmin

    syshackmin Member

    Joined:
    Jan 20, 2004
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Been diggin for a little bit figuring this would be easy to find but can't seem to. I want to reset the permissions on a user directory to what they should be by default. I need to do this because I copied a directory from another server which seems to have very incompatible permissions. I've been manually resetting things to what I think is right but I'm not exactly sure. I have to do this with about 100-150 more users so a automated method would definetly help me out a bit.

    Thanks!
     
  2. Mykul31217

    Mykul31217 Member

    Joined:
    Aug 4, 2004
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    Bump

    I have a similar issue after a server crash and need to get permissions reset for everyone.
     
  3. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    I believe there is a fix script in /scripts/ that can do this for you. I'm not online using my normal office machine at the moment so I am unable to look this up to provide specifics.
     
  4. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,471
    Likes Received:
    199
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Running these from SSH one by one should work;

    for CPAccess in `ls -A /var/cpanel/users`; do chown -R $CPAccess:$CPAccess /home/$CPAccess; done

    for CPAccess in `ls -A /var/cpanel/users`; do chown -R $CPAccess:mail /home/$CPAccess/etc /home/$CPAccess/mail; done

    for CPAccess in `ls -A /var/cpanel/users`; do chown -R $CPAccess:nobody /home/$CPAccess/public_html; done

    /scripts/chownpublichtmls

    Depending on how you're setup you might need these:

    find /home*/*/public_html -type d -perm 0777 -exec chmod 755 {} \;
    find /home*/*/public_html -type f -perm 0666 -exec chmod 644 {} \;

    To take care of one users account this may be all you need.

    chown -R usernamehere:usernamehere /home/user/public_html/* ;

    Don't run any of them if you're unsure what you're doing. Hire someone to help might be the best option.
     
Loading...

Share This Page