0

I am creating a new forum in a virtual webhost with a common forum package, and the instruction asked me to set some files to 777, is that safe? I had ran the forum in my local computer for months, I used xampp with all security setting I could find online to make it more safe, but I didn't change any permission with those file, did I do something wrong with security?

  • 4
    As a rule of thumb, without a clear understanding of why it would be required, setting 777 permissions is unsafe. – Marcks Thomas Sep 20 '13 at 14:54
  • 3
    Actually you did make those file permissions you just don't know it. If you want to use the forum software it will require those permissions changes. Since you don't indicate what files, what folders, or the software being used an answer isn't really possible. "is it safe" isn't something we can answer based on the information provided. – Ramhound Sep 20 '13 at 14:56
  • chmod 777 is the equivalant off "I can not find my keys. Solution: Always leave all windows and doors wide open". It is almosts never the right solution. – Hennes Sep 12 '16 at 6:21
3

If a file has 777 permissions, anyone can read or write/delete anything in that folder.

Linux is a multiuser operating system, so you are allowing anyone that can log in to it, whether through SSH or physically through the console, to do anything in that folder.

Any program running as any user has the same privilege as well.

Note that people accessing your forum software don't login, but cause access to files as the user apache is running as, typically www-data.

It would be better to set the owner (chown) and owner-group (chgrp) of the file appropriately, and then at the very least chmod 770 it.

If it's a forum web application running under a typical LAMP stack, you probably want to set the owner and owner-group of this to www-data.

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.