Setting Permissions in Batches

Discussion in 'Site & Server Administration' started by yfs1, Jul 28, 2005.

  1. #1
    Is their an easy way in CPanel to set permisions for all of the files in a folder at once. I tried setting the folder but that doesn't affect the individual files. There are several hundred .txt files so it will take a long time one by one. I've always previously been on Windows servers so I am still adjusting.

    Cheers
     
    yfs1, Jul 28, 2005 IP
  2. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #2
    Do you have shell access on the machine? Or does CPanel let you trigger a shell command?
     
    digitalpoint, Jul 28, 2005 IP
  3. RectangleMan

    RectangleMan Notable Member

    Messages:
    2,825
    Likes Received:
    132
    Best Answers:
    0
    Trophy Points:
    210
    #3
    with ssh...

    chmod -R 664 folder/

    -R is recursive meaning it will follow through folders

    If want everything inside a directory and all subs you can use

    chmod -R 664 *

    The asterisk is ALL.

    chmod -R 644 *.php

    This will chmod all .php files.

    Also 664 is just a chmod example of course you may want 775 or 777 or whatnot. Make sure all folders are at least 755 or else apache can't open them.

    As for Cpanel...not that I am aware of.
     
    RectangleMan, Jul 28, 2005 IP
  4. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #4
    Blarg!!!! It's an easy way to kill a server. I did

    chmod -R 666 /

    and my server crashed! I was in a site directory and I think it did the whole server, and then it had a kernal attack.
     
    Nintendo, Aug 16, 2005 IP
    minstrel likes this.