0

I am stuck at trying to change the owner of directory /var/www/html/* from user to group.

I want to make the group developers to be the owner of that directory and all sub-directories. Is it possible to make a group owner of directory instead of user in Ubuntu 14.04, and how ?

So far i tried chown :developers -R /var/www/html/* but it seems to be not working.

I hope you can help me.

Thanks in advance!

  • Have you tried sudo chown -R apache2:developers /var/www/html, assuming that apache2 is the appropriate user owner? – Daniel Jan 14 '16 at 17:57
2

First of all files will still have user owner. They always have user and group owner. Anyway - to make group owner set to developers for all contents of your dir:

groupadd developers
chgrp developers -R /var/www/html/*

This doesn't affect user owner.

  • So two different users can not edit same file in that directory ? – Venelin Vasilev Jan 14 '16 at 18:18
  • They can, as long as they have proper permissions on that file. Take a look at this: help.ubuntu.com/community/FilePermissions - it should clarify file permissions for you. – Jacek Jan 14 '16 at 18:22
  • I think i do not understand it properly. For example how user user1 and user2 can have full access to all files and folders in /var/www/html/* ? – Venelin Vasilev Jan 14 '16 at 18:29
  • Please read the link I provided - it will clarify it. Long story short - one thing is who's the owner (user and group), another what are the permissions for user, group and others. – Jacek Jan 14 '16 at 18:31
  • I have run sudo chmod -R 777 /var/www/html/* but when i try to edit file with user2 with WinSCP it says the user has no permissions... – Venelin Vasilev Jan 14 '16 at 18:40

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.