I have an issue with the use of /home as www folder. Actually I'm using userdir mod on ubuntu 14.04 and apache2.4 in order to have all my websites in home folder. Everything was working so far. But I made a mistake in my permissions and my www-data user write in the folder of my home, and he becomes owner of the written files. Which makes the true home folder owner incapable to delete it.

I tried (with root access) :

chmod -R 775 /home/administrateur/
chmod -R ug+rwx  /home/administrateur/
chown -R administrateur:administrateur /home/administrateur/
chgrp -R administrateur /home/administrateur/

With no success, the files which are written remains the property of www-data.

Thanks for helping

  • Could you post namei -mo /home/administrateur and ls -l /home/administrateur commands output?
    – Lety
    Oct 24 '14 at 18:44
  • Ok @Letizia first of all, www-data is writing in a subfolder in /home/administrateur/www/subfolder For the returns : namei -mo /home/administrateur returns : drwxr-xr-x root root / drwxr-xr-x root root home drwxrwxr-x administrateur administrateur administrateur ls -l /home/administrateur returns : drwxrwxr-x 6 administrateur administrateur 4096 Oct 9 14:55 www
    – Neovea
    Oct 24 '14 at 20:53

Try to add sudo before your commands, because if you don't have write access on your files, you can't change their attributes.

  • I edited my post. I used the root account.
    – Neovea
    Oct 24 '14 at 17:20

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.