[Samba] Force user and replace with SUID and SGID

Michael Kelly mkelly at victoria.komex.com
Mon Dec 6 18:02:18 GMT 2004


Hi all,

I am trying to get rid of a force user setting on our samba server. I
read an article that talked about setting the SUID and SGID on the
top-level directory, and all sub-directories, of a share and this would
cause all files to be own by the user and group for which the sticky bit
has been set.

Here is what I did.

1. recursively changed owner/group on all file and directories in the
share to the user and group who I wanted to own said files and
directories.
2. executed "find /mnt/fileserver/server -type d -exec ug+s {} \;" to
set the sticky bit on all directories within the share.
3. removed the "force user" entry from the share definition and
restarted Samba
4. Browsed the share and created a new file. It came up as owned by me
not the user who I had set the sticky bit for. It did have the proper
group as I am a member of that group.
5. Opened and Excel file and then closed that file. It prompted me to
save changes, made none, and when I said no it updated the time stamp
anyway.


I am using the "force user" entry to solve the known problem with
Microsoft Office files. I have about 14 employees who access the share
and all file and directories within it. Timestamps are very important
and we need them not be changed when simply viewing a file.

It was my understanding that by setting the SUID and SGID it would
cause all files to retain their ownership and all newly created files to
get the user and group for which the sticky bit was set. 

I know that this is a Linux file system question, but it is relating to
Samba and I am hoping that someone out there has experienced this and
can point me in the right direction.

Thank you
Michael Kelly


More information about the samba mailing list