[Hudlug] file permissions in Samba

Tim tim at kooky.org
Thu Nov 20 09:16:45 GMT 2003


Simon Fox-Jones wrote:
 > Both users A and B are added to the group office and the permisions 
were are
 > set so that the group is RWX on the file in question , yet each time 
either
 > of the users uses the file they seem to take ownership and then 
change the
 > group permissions to R only, its very bizzare


It will be the permissions mask in samba. Samba just follows what the
filesystem does, but a permissions mask is applied to files.  For
instance, this makes it harder to accidently make world readable files
in your home directory.

Also, a file which appears to be modified may actually have been deleted
and recreated - hence the change in owner.   Your access has to depend
on group rather than owner.


  From my samba.conf


[shared]
     path = /shared
     comment = Shared area
     writable = yes
     locking = yes
     force  create mode = 0770
     force directory mode = 0770
     create mask = 0770
     directory mask = 0770

-------------
tim at merlin:~$ ls -la /shared/
total 995
drwsrws--x   15 root     staff         568 Nov 16 16:22 .
drwxr-xr-x   22 root     root          624 Jun 12 13:13 ..

----------------------


In addition, you may want to set the group sticky bit and user.group on
the base directory, so that any files created under unix (and samba)
will inherit the correct group.

Any file created by samba is group read/writeable by group staff.  Any
file created by somebody logged onto the box becomes group readable, but
not group writable unless you do a quick chmod (because the files get
set to group staff automatically)

Hope this helps.

If you want all this explaining, installing, security verifying etc,
then contact me professionally.

Tim






More information about the Hudlug mailing list