chmod command? entire hosting account?

Discussion in 'Site & Server Administration' started by Adulu, Mar 10, 2011.

  1. #1
    Hello,
    i moving my site to new web hosting.
    but files after unzip is 644, so have to chmod.

    how to chmod entire account? it's 755?

    can you show me chmod command?

    thank you
     
    Adulu, Mar 10, 2011 IP
  2. rds100

    rds100 Peon

    Messages:
    25
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    chmod -R 755 /directory/path
     
    rds100, Mar 10, 2011 IP
  3. Adulu

    Adulu Peon

    Messages:
    2,791
    Likes Received:
    43
    Best Answers:
    0
    Trophy Points:
    0
    #3
    under /directory/path/ all directories with files will be 755?
     
    Adulu, Mar 10, 2011 IP
  4. rds100

    rds100 Peon

    Messages:
    25
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Yes, -R means recursive. Every file in every subdirectory of /directory/path will be chmod to 755. And the subdirectories themselve will be also chmod 755.
     
    rds100, Mar 10, 2011 IP
    Adulu likes this.
  5. Adulu

    Adulu Peon

    Messages:
    2,791
    Likes Received:
    43
    Best Answers:
    0
    Trophy Points:
    0
    #5
    thanks so much.
    it's work.
     
    Adulu, Mar 10, 2011 IP
  6. RHS-Chris

    RHS-Chris Well-Known Member

    Messages:
    1,007
    Likes Received:
    35
    Best Answers:
    10
    Trophy Points:
    150
    #6
    Hello there,

    The more secure way would be to keep all of your files with 644 permissions, and only chmod the files that you absolutely have to. Directories can have 755 permissions, files should not.

    Chris
     
    RHS-Chris, Mar 11, 2011 IP
  7. raffo77

    raffo77 Active Member

    Messages:
    234
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #7
    Hi,

    Put chmod 755 all files + all directory are total wrong!

    But if you really need the directory chmod 755 put it.

    To chmod only the files in 644 the command are:
    find . -type f -exec chmod 644 *.* {} \;

    RAFFAELE
     
    raffo77, Mar 14, 2011 IP
  8. jacobatwood

    jacobatwood Peon

    Messages:
    76
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Use flag -R :

    chmod -R [permissions] [dir name]

    It will make chmod descend into directories.
     
    jacobatwood, Mar 17, 2011 IP