Reputation: 725
What is the minimum permissions to set the site files to, in order to allow apache2/php to execute code, show html/css/js, and for some files update settings download and install plugins.
The websites I am building are either Drupal or Wordpress.
I'd like to set permissions so that www-data
has the minimum permissions and the admin (which is me for now) has permissions to allow him to do tasks from an SSH session without needing sudo
.
[Edit] I'd like to add that I have full access to the LAMP server via SSH. What I am after is the most restrictive and hence the most secure way to set user and group permissions, so in short:
For all site files for say a wordpress In order to achieve
Upvotes: 0
Views: 2811
Reputation: 4364
Mostly the directory should have the permission set to 755. If you set it to 777 then the files can be written there. Files should be, at most, 664. If you use the WP editor, you might need these files to be 666 but you really should revert them back to 664 after making any changes. Never specify files greater than 666 unless specified.
Some hosting only allow uploads on 777 permission only avoid such and try contacting hosting for this.
See at https://codex.wordpress.org/Changing_File_Permissions
Upvotes: 1