I have got some issues in running a PHP file that needs to do shell_exec, fopen and fwrite things. so after trying to change the permissions the script is working fine now . Now I am having this type of permissions for www folder
drwxrwx— 16 root www-data 4096 Nov 29 01:41 www
and within www folder all folder are having the following permissions drwxrwx— 3 root www-data 4096 Nov 27 23:41 foldername
all files within the /var/www/ are having the following permissions -rwxrwx— 1 root www-data 13 Nov 27 13:09 index.html
Is that recommended and secured to have these permissions ? all files, even the non executable files are in green color .
if its not secured, then what kind of permissions should I have to apply ?
thanks in advance !
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
I think that it is best to have 644 permissions on your files. Now you have 770. To change the permissions on your directory or files execute: chmod 644 /the/path/to/the/file
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.