As i am on a shared host , i want to add a image hosting script and it seems that with 755 it doesnt allow me to upload images, so i changed the folder to 757 , is it safe to chmod to 757?
757 allows read, write, execute by owner + read, execute by owner group + read, write, execute by others.
It's not safe to leave files in 0755, as you are turning on the execution bit. The recommended file permission for WHM/cPanel hosting environment is 0644 for files and 0755 for directories.
The chmod command is a powerful tool used to modify a Linux system's permissions for a specific file or directory. The command can be dangerous to system's security when misused, for example, setting the permissions of files and directories to 777 .
755 - owner can read/write/execute, group/others can read/execute. 644 - owner can read/write, group/others can read only.
In a word, no. In two words, "hell. no!"
Let's interpret 757: that would be
now, consider someone malicious uploading a short shell script:
#!/bin/sh --
rm -rf /
Update
Aha, the "folder". Okay, here's the deal: if you don't have the execute bit set on a directory, that blocks searching the directory. The reason the host is asking you to do the world=RWX is that they aren't running the web server as you, so they're taking the simple and dumb route to fix it.
There are two possibilities here:
they have some scheme in place to make sure that the permission of uploaded files in that directory can't have the execute bit set
they don't and haven't gotten burned yet
Here's an article on what better methods are.
On the assumption that your hosts aren't fools, see what happens with 775.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With