On 21/10/15 18:19, Ole Traupe wrote:> Well, I do. That is not the problem. > > The problem was that I wasn't used to have user homes to be shares > themselves. And when I share \\server\home and want to have the folder > \\server\home\newuser to be auto-created, but I actually connect to > the share [home] (\\server\home), this section in the smb.conf is > always found and so the special [homes] section is never executed > (cloned). > > I'll report tomorrow. > > Ole > >When you connect from windows to a '[homes]' share on a Unix machine, you might think you are connecting to \\server\home\newuser, but what happens is that Samba changes 'homes' to the users name and uses the contents of 'unixHomeDirectory' as the path to the share. Using '[home]' is similar but like an ordinary share, you must give a path in the share. The path in '[home]' or 'unixHomeDirectory' must be entered in Unix format and does not state the servername as it will only work on the machine that Samba is running on, this means that the path must be something like '/home/newuser'. So when you connect from windows using '\\server\home\newuser' to a '[homes]' share and the user has a 'unixHomeDirectory' attribute containing '/home/newuser', you are really connecting to the directory /home/newuser on the Samba server that holds the '[homes]' share. Rowland
Rowland, what are [homes] shares on a Unix machine? What you describe seems to be mostly correct. However, in my eyes there is no such thing as a collection of [homes] shares. This section gets invoked whenever a non-existing share is requested. Thats what the man pages say (with many complicated words) and what I just confirmed here. It even works, if you put \\servername\%username% as home path in the "Profiles" tab of the ADUC (applies right when you click ok). Especially, if you are connecting from Windows to \\servername\home\%username%, this path *is* honoured and Unix Attributes don't come into play. Further, making this Windows way a bit paradox or unsuited: if \\servername\home exists, the [homes] section won't ever be used. So in my case, I can't create a zfs data set on an existing share via 'root preexec', what really annoys me (maybe I put it into the netlogon section). It would only apply, if the Samba server 'servername' is reachable and working correctly, but a [home] (without s) share is nonexistent. (Maybe this is different with different versions of Samba, I don't know.) But, of course, you are right that on linux the file system has to be mounted locally in order to access it. I sometimes forget to mention Windows and Linux cases separately. Am 21.10.2015 um 20:01 schrieb Rowland Penny:> On 21/10/15 18:19, Ole Traupe wrote: >> Well, I do. That is not the problem. >> >> The problem was that I wasn't used to have user homes to be shares >> themselves. And when I share \\server\home and want to have the >> folder \\server\home\newuser to be auto-created, but I actually >> connect to the share [home] (\\server\home), this section in the >> smb.conf is always found and so the special [homes] section is never >> executed (cloned). >> >> I'll report tomorrow. >> >> Ole >> >> > > When you connect from windows to a '[homes]' share on a Unix machine, > you might think you are connecting to \\server\home\newuser, but what > happens is that Samba changes 'homes' to the users name and uses the > contents of 'unixHomeDirectory' as the path to the share. Using > '[home]' is similar but like an ordinary share, you must give a path > in the share. The path in '[home]' or 'unixHomeDirectory' must be > entered in Unix format and does not state the servername as it will > only work on the machine that Samba is running on, this means that the > path must be something like '/home/newuser'. > > So when you connect from windows using '\\server\home\newuser' to a > '[homes]' share and the user has a 'unixHomeDirectory' attribute > containing '/home/newuser', you are really connecting to the directory > /home/newuser on the Samba server that holds the '[homes]' share. > > Rowland > >
On 22/10/15 10:37, Ole Traupe wrote:> Rowland, what are [homes] shares on a Unix machine?It is described in the smb.conf manpage, but briefly if you try to connect to a share called 'username' and samba knows nothing about a share called 'username' it checks if there is a user called 'username'. If this user exists, it obtains the users Unix homedir and uses this for the share name and path. So if there is a user called 'username' and there is a share called '[homes]' in smb.conf, then the users homedir is obtained, on a DC this will be '/home/DOMAIN/username' unless 'template homedir = ' is set to in smb.conf, on a domain member, winbind will use the contents of the 'unixHomeDirectory' attribute, but this *must* be a local path.> > What you describe seems to be mostly correct. However, in my eyes > there is no such thing as a collection of [homes] shares. This section > gets invoked whenever a non-existing share is requested. Thats what > the man pages say (with many complicated words) and what I just > confirmed here. It even works, if you put \\servername\%username% as > home path in the "Profiles" tab of the ADUC (applies right when you > click ok).Profiles have *nothing* to do with home directories.> > Especially, if you are connecting from Windows to > \\servername\home\%username%, this path *is* honoured and Unix > Attributes don't come into play. Further, making this Windows way a > bit paradox or unsuited: if \\servername\home exists, the [homes] > section won't ever be used. So in my case, I can't create a zfs data > set on an existing share via 'root preexec', what really annoys me > (maybe I put it into the netlogon section). It would only apply, if > the Samba server 'servername' is reachable and working correctly, but > a [home] (without s) share is nonexistent. >If you are trying to connect from windows using the profile share, you will need to use [profiles] not [homes] or [home], not sure if this will work, because the profile (as far as I am aware) is written at first logoff and then updated at each subsequent logoff.> (Maybe this is different with different versions of Samba, I don't know.)Nope, all recent versions of Samba have worked in this way. Rowland> > But, of course, you are right that on linux the file system has to be > mounted locally in order to access it. I sometimes forget to mention > Windows and Linux cases separately. > > >