Home > Back-end >  What is the best octal permission for a config.php file?
What is the best octal permission for a config.php file?

Time:11-02

So let's say that I have a LAMP stack project hosted on a Linux server with cPanel on it with only one user. What is the permissions that I'm supposed to set to a file with passwords and API keys being set on it?

CodePudding user response:

The best permissions for you will be 644. It means that the owner (user, who will deploy the code) has read and write permissions, the group and other users have only read permission. If your user is in the same group as web-server user (www-data, apache2, etc.) and the file is owned by this group, you can reduce permissions to 640, with this config all other users have no rights to read/write/execute the file.

  • Related