I am really confused about ownership www-data vs [username] (ex: admin, mike). www folder owned by [username] same as any folder or file created, great. So why do I need to change owner to www-data? some applications/scripts does not work unless owner is www-data.

After changing owner to www-data then logging to FTP/SFTP by [username] I cannot change anything as "Permission denied".

Is it possible to set owner to "www-data" and do not get "Permission denied"?

Is it important to set owner to "www-data"?

I understand it's apache user and group but I thought folder should be owned by website username.


It is important. Changing the owner to www-data is a security issue. If you don't, you have to run the web server (apache) as another user. If someone is able to get control of your web server they can do anything that user can do, access files, delete files, change permissions, etc. The idea is that if you use www-data for your web server then someone who gains control of your web server won't have the permissions needed to cause much damage outside of your website.

I believe you can allow access for your user and www-data using this method: (No "Permission denied" error.)


| improve this answer | |

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.