While setting up my webserver I gave all my public folders 777 permissions with filezilla, I found out that this is very bad because everyone can put stuff in that folder at the moment. I have a website that has a fileupload form (laravel). I searched a bit around and found out I had to give the 'www-data' user the appropriate rights to write files.

So what is the www-data user? is it an user generated automaticly.

When changing permissions with an ftp client like filezilla to 777 whos permissoins am I setting ?

  • NEVER SET 777! If you are doing this, you're doing it wrong and don't have good permissions setups - time to redo your perms – Thomas Ward Dec 10 '15 at 14:18
  • @ThomasW. Thats exactly why i posted this question ;) – Sven van den Boogaart Dec 10 '15 at 14:42
  • Please, Can you set here the routes/path to directory public? – Jose Carlos Ramos Carmenates Dec 10 '15 at 21:50
  • @JoseCarlosRamosCarmenates /var/www/dmydomain.eu/public – Sven van den Boogaart Dec 10 '15 at 21:52

www-data is the user under which your Apache/Nginx runs.

Setting permissions to 777 grants read/write/execute access to the owner, the group and everyone else.

When only www-data needs access, you could change the owner of the file/folder and set permissions to something like 755.

This information might help: https://en.wikipedia.org/wiki/File_system_permissions

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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