Problem: Whenever I write a new file/modify a file in my www
folder, permissions and ownerships are being reset on that file, sometimes making the server unable to read the files I create. So I need to go to the terminal, set the ownerships etc. which is very tedious.
My www
folder is accessible through Samba.
Whenever I write or modify anything to that folder I get the permissions and ownership of the file reset to jay:jay
that can't be read by apache
.
I looked up online and saw this question. So I tried:
sudo setfacl -Rdm g:apache:rx www
sudo chmod g+s www
now the result is this:
drwxr-sr-x+ 14 jay apache 4096 Aug 15 21:09 www
But now whenever I try something like:
touch somefile.txt
I get these settings:
-rw-r--r--+ 1 jay apache 0 Aug 15 23:07 somefile.txt
I thought the permissions would keep the folder's permission, no?
regarding the ownership it is ok, but the permissions are not kept!
- Say I wanted to make a 750 chmod automatic for
jay
's writing to the folder. How would I go about that? - I assume the little
's'
marks the setgid? Does this mean anything written inside of this folder would be given the folder's group's ownership? Why doesn't it affect my files? I thought the settings of a newly created file would be just like the containing folder's
(www)
which isrwxr-xr-x
Is there a way to simply undo the
setfacl
? That is take out the little'+'
in the permissions line?
I am running Ubuntu 12
-b
option ("Remove all extended ACL entries") - is that more appropriate for resetting? I am not sure, which is why I didn't touch on that question. – muru Aug 15 '14 at 21:52sudo
can inherit the umask, or use the umask specified insudoers
. – muru Aug 15 '14 at 21:56