[KLUG Members] linux directory permissions

Adam Tauno Williams adam at morrison-ind.com
Tue Jan 4 14:42:25 EST 2005


> Anyway.
> I made a /home/budget folder and set the permissions to:
> drwsrwsr-x   22 budget   budget       4096 Jan  4 13:33 ./
> drwxrwxr-x   44 root     staff        4096 Dec 23 15:16 ../
> The article said that when a user creates something in it the owner and
> group wound be set to budget:budget.
> When I create a file it gets set to pescej:budget rather then the usual
> pescej:staff
> Why isn't the owner being set correctly?

Off the cuff this looks correct to me.  g+s makes the group ownership of
new files to be the same as the group ownership of the directory itself.
I don't think g+s has or has ever had an effect on user ownership,
niether do I think u+s on a directory provide the functionality you're
looking for.

(a) Having the group ownership set correctly should be sufficient.
(b) If you need more granular control then you need ACLs.

>From man setfacl -
     A directory may contain default ACL entries. If  a  file  or
     directory  is  created  in a directory that contains default
     ACL entries, the newly created file  will  have  permissions
     generated  according to the  intersection of the default ACL
     entries and the permissions requested at creation time.  The
     umask(1)  will  not  be  applied  if  the directory contains
     default ACL entries. If a default ACL  is  specified  for  a
     specific  user  (or users), the file will have a regular ACL
     created. Otherwise, only the mode bits will  be  initialized
     according  to  the intersection described above. The default
     ACL should be thought of as the maximum discretionary access
     permissions that may be granted.



More information about the Members mailing list