what is ssh command for chmod on all files?

Discussion in 'Site & Server Administration' started by marketing, Nov 8, 2007.

  1. #1
    I have an entire html directory that has permission screwed up when moving to a new server. I would like to chmod all the files AND directories to 755 via ssh, but can't think of the command to do this...can you help?
     
    marketing, Nov 8, 2007 IP
  2. beejaysea

    beejaysea Peon

    Messages:
    141
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    The answer is: chmod -R 755 *

    But, I would warn you to take care when executing this. Also, it's not a _great_ idea to have files with the "x" bit on them. It's better to have files "rw-r--r--" (644). Directories need to have "x" in order to be traversed into, so they get "rwxr-xr-x" (755) typically. If you have "x" on the files themselves, then they can be "executed". If there is malicious script code in one of these files, it could potentially be exploited. Rarely does this occur, but best practice is to NOT have "x" on your html files.

    HTH.
     
    beejaysea, Nov 8, 2007 IP
  3. inworx

    inworx Peon

    Messages:
    4,860
    Likes Received:
    201
    Best Answers:
    0
    Trophy Points:
    0
    #3
    As beejaysea said, CHMOD 755 isn't a good idea for all files on the server. Specially, there are many exploits done through the temporary directories, and be sure to take extreme care while playing with ssh. It could do everything with the server..
     
    inworx, Nov 11, 2007 IP