File Permission for Web Site Files

File Permission for Web Site Files | techfaqsolutions
Spread the love

To use website files on the hosting server, your server should have permissions to access them. This was organised to provide better security measures and not allow the hacker and malicious code to access to important files.

We need to setup permission to each file and directory in the server.

0 — nothing can be done. File or folder are completely inaccessible.
4 — read only.
2 — write only.
1 — execute only.
5 (4+1) — read and execute.
6 (4+2) — read and write.
7 (4+2+1) — read, write and execute. Full access.

The File Permission for Web Site Files is 644 and 755 for the directory. You can use the below script to give correct permission for all files and directories in the current working directory. Go to the site document root and just run below two commands in the terminal.

find ./ -type f -exec chmod 644 {} \;
find ./ -type d -exec chmod 755 {} \;

 

 


Spread the love

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *