What is the correct permission for folders on linux servers in production? [duplicate]

3

Reading the PHP manual and some tutorials I was in doubt about what permission to leave in the folders after image uploads. Some tutorials speak to leave as 0755, others like 0750, which one to use in this case for application security and web server?

1st Example:

chmod ("/arquivo/diretorio", 0755);

2nd Example:

chmod ("/arquivo/diretorio", 0750);
    
asked by anonymous 19.10.2016 / 23:43

1 answer

3

Permission is given as follows:

The first octet is the permission for the user (owner of the file), the second octet is for the group, the third octet is for all other users. It is important that you leave minimal permission for unknown users to prevent attacks on the server.

    
20.10.2016 / 00:35