Recursive modify directory permissions to 755, file permissions to 644

For the opening of the website and the system, file access control is a very important thing, file and folder permissions for the principle of least privilege is enough on the line, not just the relevant files to read-only access.

Method: recursively modify the permissions to perform the specified method is based on the file permissions look after parameter corresponding to the type by the find command.

Note: The following path you need to modify the directory path.

1. Modify Owner:
#chown -R & lt root.root path (specified path recursively all files modified group for all users is root)

2. Modify the directory permissions:
#find path -type -exec the chmod 755 {D};

3. Modify the file permissions:
#find path -type -exec the chmod 644 {F};

Note: The above method remember some specific directories need special permission to go back and change, such as general site cache folder, the Home index.html, etc., attachment upload directory, etc. After modifying.

Published 218 original articles · won praise 165 · Views 1.03 million +

Guess you like

Origin blog.csdn.net/x_i_y_u_e/article/details/102893167