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.

How to change the permissions to multiple files at once?

Discussion in 'General Discussion' started by robi_70, Feb 10, 2016.

  1. robi_70

    robi_70 Member

    Joined:
    Jul 25, 2011
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Hi,

    I moved to a new server with cPanel account with PrestaShop installed there (on the old server was also Cpanel). Unfortunately, for reasons unknown to me on the new server, all files are PrestaShop powers 666. A should be 644.
    Presta has a huge number of files in multiple directories and subdirectories.

    Is there a simple way to change the permissions of all files?
     
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,474
    Likes Received:
    202
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Code:
    find /home/username/public_html/prestashop -type d -perm 0777 -exec chmod 755 {} \;
    find /home/username/public_html/prestashop -type f -perm 0666 -exec chmod 644 {} \;
    Assuming thats where your shop is, they should work.
     
  3. robi_70

    robi_70 Member

    Joined:
    Jul 25, 2011
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    I'm not an expert in this field. Please tell me where I got this code apply?
    I logged in to the server via SSH (puty) and I wanted to use this code, but getting feedback messages such as: "-bash: -type: command not found", "-bash: type: -perm: not found", "..."

    What am I doing wrong?
     
  4. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,474
    Likes Received:
    202
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Do you have root access to this server?
     
  5. robi_70

    robi_70 Member

    Joined:
    Jul 25, 2011
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
  6. SysSachin

    SysSachin Well-Known Member

    Joined:
    Aug 23, 2015
    Messages:
    326
    Likes Received:
    24
    Trophy Points:
    18
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hi,
    May I know are you access your server directly with root user or first access server with super-user then root?
    Also, let me know which OS installed on your server.
     
  7. robi_70

    robi_70 Member

    Joined:
    Jul 25, 2011
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    excuse me! My mistake.
    I made a mistake typing a command!
    Now it is discovered.

    The code worked.
    Thanks a lot!
     
  8. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page