I need help understanding how giving write permission to a group, works in Ubuntu. I am logged in as root and have a www-data:www-data
and ftpuser:ftpuser
(user:group
). I add the ftpuser
into the www-data
group using:
usermod -a -G www-data ftpuser
Now my www-data
group has two users.
I then make the group www-data
, owner of the folder /var/www
using:
chgrp -R www-data /var/www
Still i have no write ability to the folder by a group member (though the group owns it) unless i give write permissions to the group. Now according to this best answer i also need to set the permissions to the directory using sudo chmod -R 770 /path/to/the/directory
and this is what confuses me.
If a user is the owner of a directory why can't he write to it?
Can a user of a group give the group write permissions to a folder owned by the group himself?
Where is the group defined in the command sudo chmod -R 770 /path/to/the/directory
? Won't this give recursive permissions to all users?