Apache: difference between chmod 644 and chmod 666 and chmod 600 for output/txt/dat?
Hello,
What is the difference between chmod 644 and chmod 666 and chmod 600 for output/txt/dat on website/apache server? Little confused, in terms of security, and for board / messages... ? Quote:
|
Hi
The files always have an owner. If the file is written by the web-server, the owner will be www-data or similar. 600 : Only owner can read/write 644 : Only owner can write, others can read 666 : All uses can read/write. |
Quote:
And why fput (php) says it is better to be 666 than 644, since 644 is working too. Code:
$file = fopen("usernamefile.txt","w"); |
Well, the web-server is the owner of the file then, and then only the first digit matters.
|
Quote:
I quote this: Quote:
|
Well, that's a different question. Usually www-data does not have many privileges, while other accounts on a web server have a lot more. So preventing e.g. you to read/write the file, does not add much to security. You could of course chown, then chmod it 600, but that's more like securing the web server from you. :)
|
I don't use the numerical permissions, they are rather obscure. Just use the regular ones, that way you know exactly what you are doing.
|
All times are GMT -5. The time now is 03:21 AM. |