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!

recursive command to set permission

Discussion in 'General Discussion' started by leonep, Feb 6, 2017.

  1. leonep

    leonep Well-Known Member

    Joined:
    Nov 18, 2014
    Messages:
    88
    Likes Received:
    2
    Trophy Points:
    8
    Location:
    Pescara
    cPanel Access Level:
    Root Administrator
    Hi,
    i want to know if is secure to use the recursive commands for assign the permissions. i have read something here time ago with security problem about recursive chown

    this command can be consider safe ? i use suPhP
    the purpose is to correct all files in public_html

    for user in `ls -1 /var/cpanel/users | grep -v "\/"`; do find /home/$user/public_html/ -name "*" | sed 's/ /\\ /g' | xargs -n 1 chmod 644; find /home/$user/public_html/ -type d | sed 's/ /\\ /g' | xargs -n 1 chmod 755; find /home/$user/subdomains/ -name "*";find /home/$user/subdomains/ -type d | sed 's/ /\\ /g' | xargs -n 1 chmod 755;done


    thanks
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,214
    Likes Received:
    1,937
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    It's generally advised to avoid using recursive chown or chmod commands. For instance, it's possible a user has intentionally configured the permissions on a file/directory to something other than 0755 or 0644.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    16,518
    Likes Received:
    425
    Trophy Points:
    583
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    I'm guessing you're referring to this old post:
    Switching to suPHP

    That thread is still of value I think.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. leonep

    leonep Well-Known Member

    Joined:
    Nov 18, 2014
    Messages:
    88
    Likes Received:
    2
    Trophy Points:
    8
    Location:
    Pescara
    cPanel Access Level:
    Root Administrator
    thanks is it
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    #4 leonep, Feb 6, 2017
    Last edited: Feb 6, 2017
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice