[cifs-protocol] Sharing /home with Samba/CIFS

Tom Hansen tomh at uwm.edu
Tue Oct 21 14:12:32 GMT 2008


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 2.6.18.1 kernel.  On the 
client, running Linux 2.6.24, 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 2.6.18.1 kernel that I am stuck with on the server.


-- 
Tom Hansen
Senior Information Processing Consultant
UWM Great Lakes WATER Institute
www.glwi.uwm.edu
tomh at uwm.edu




More information about the cifs-protocol mailing list