Tom Hansen | 21 Oct 2008 16:12
Picon
Favicon
Gravatar

Sharing /home with Samba/CIFS

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 
(Continue reading)

Stefan (metze) Metzmacher | 23 Oct 2008 08:23
Picon
Favicon

Re: Sharing /home with Samba/CIFS

Hi Tom,

the cifs-protocol mailing list is for technical discussions about
protocol details, please use samba@... for samba related
user questions.

metze

> 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.
> 
(Continue reading)


Gmane