Sharing /home with Samba/CIFS

Thomas F Hansen tomh at
Mon Oct 20 18:02:49 GMT 2008

Apologies if I have posted this before-- I thought I did but I did not find it in the archive nor received any responses, so here it is again:

I would like to use Samba to share the /home directory from one machine to another.  So, I need the following to work:

1.  In the share, any file created by a user needs to be owned by that user.
2.  The system needs to obey the SGID bit for directories, which means:
    a.  Any file created in a directory with SGID set, will inherit the directory's group ownership.
    b.  Any directory created in said directory will inherit the group ownership, and also have its SGID bit set.

On the server, I am running Samba 3.0.22 on a kernel.  On the client, mount.cifs reports version 1.10-3.0.28a.

I started by simply mounting the share using mount.cifs as root.  Unix extensions are turned on at the server, so I figured everything would "just work."  Unfortunately, it did not.

The primary problem is that new files created by a user do inherit the group of SGID parent directories, but the owner is always set to root.  This is a slight problem.

I tried setting the "setuids" option on the server, but this simply results in new files always having the user ID and group ID set to the owner, indiscriminately, completely ignoring the SGID bit of the parent directory.

Can I get this to work somehow?

P.S.  Yes, I tried NFS, which is what is normally used for this sort of thing, but unfortunately many of the users belong to more than 16 groups, which breaks NFS3.  NFS4 supposedly solves this, but it doesn't work properly on the kernel that I am stuck with on the server.

Tom Hansen
Senior Information Processing Consultant
UWM Great Lakes WATER Institute
tomh at

More information about the samba-technical mailing list