I've searched a lot and I can't find a properly answer for my case. I think it has something to do with groups, but I can't discover a solution that fits me.

So here's the deal:

I have a home server on CentOS, and I use vsftpd.

I created a user miguel and made the default ftp location to var/www/html/ (as I'm the only user).

The question is - I have a php script which allows everyone on the internet to upload files to my server (in this moment, they're going to a folder called user_files, inside var/www/html). When I check locally the permissions of that folder, they are assigned to apache:apache. When I access via ftp with the user miguel I can't access/write on that folder.

How can I override all permissions, to give `miguel``, locally or via ftp, a "superaccess" permission to that folder?



You could add miguel the the apache group and make sure the group has write access to the folder.

useradd -G apache miguel
chmod 764 -R /var/www/html

You might want to adapt chmod to fit your requirements.

  • Hello and thanks for the answer. But no, it didn't worked. miguel is already in the group apache and still doesn't have write permissions on that folder. – Filipe Pires Sep 16 '13 at 17:38
  • Are you sure your vsftpd does not jail your user so that you can never change directory to /var/www/html? This link might help you if you are unsure of what jailed is ubuntuforums.org/showthread.php?t=518293 – Qben Sep 16 '13 at 20:46

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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