On 21/10/15 17:37, Ole Traupe wrote:> I think I finally managed to understand the [homes] part of the man > pages, and what my problem is: > https://www.samba.org/samba/docs/man/manpages/smb.conf.5.html > > The misunderstanding comes from my practice I learned on Windows to > just share the "\\server\home" directory and to create per-user > sub-folders (\\server\home\newuser) that *themselves are not shared*. > > If you - as you obviously should (at least referring to Samba) - put > "\\server\newuser" as home dir path into your user config on the DC, > the manpages start beginning to make sense: The Samba file server > receiving the request to connect to \\server\newuser finds no > appropriate share entry in the smb.conf and, thus, clones the content > of the [homes] section (given the username exists and the password is > correct) for creating a new share (actually shared, no simple > subfolder of a share). > > So the user home must actually be a share and the [homes] section with > the 'root preexec' parameter has to be defined on the Samba server > hosting those home shares. > > Will try this tomorrow. >Ah, light dawns, you are confusing the 'homeDirectory' and the 'unixHomeDirectory' attributes, windows uses the first one and should as you say contain something like ' \\server\newuser', whereas Unix uses the last one and should contain the full Unix path to the users homedir i.e. '/home/newuser'. So what you are proposing to try tomorrow should work if you bear the above in mind. Rowland Rowland
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 Am 21.10.2015 um 19:00 schrieb Rowland Penny:> On 21/10/15 17:37, Ole Traupe wrote: >> I think I finally managed to understand the [homes] part of the man >> pages, and what my problem is: >> https://www.samba.org/samba/docs/man/manpages/smb.conf.5.html >> >> The misunderstanding comes from my practice I learned on Windows to >> just share the "\\server\home" directory and to create per-user >> sub-folders (\\server\home\newuser) that *themselves are not shared*. >> >> If you - as you obviously should (at least referring to Samba) - put >> "\\server\newuser" as home dir path into your user config on the DC, >> the manpages start beginning to make sense: The Samba file server >> receiving the request to connect to \\server\newuser finds no >> appropriate share entry in the smb.conf and, thus, clones the content >> of the [homes] section (given the username exists and the password is >> correct) for creating a new share (actually shared, no simple >> subfolder of a share). >> >> So the user home must actually be a share and the [homes] section >> with the 'root preexec' parameter has to be defined on the Samba >> server hosting those home shares. >> >> Will try this tomorrow. >> > > Ah, light dawns, you are confusing the 'homeDirectory' and the > 'unixHomeDirectory' attributes, windows uses the first one and should > as you say contain something like ' \\server\newuser', whereas Unix > uses the last one and should contain the full Unix path to the users > homedir i.e. '/home/newuser'. > > So what you are proposing to try tomorrow should work if you bear the > above in mind. > > Rowland > > Rowland > >
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