Unusual [homes] configuration
gentry at usaccess-inc.com
Fri Nov 21 00:38:17 GMT 1997
On Thu, Nov 20, 1997 at 05:14:11PM -0600, John Blair wrote:
> Solution 1:
> Create a new directory, such as /usr/local/samba/homes. Create
> directories with the correct ownerships for all of your class B users
> in this directory. Next, create links inside of /usr/local/samba/home
> s to the home directory of all of your class A users. These links
> can be either hard or symbolic links, depending on your disk
> partition layout and your own taste. Lastly, set 'path =
> /usr/local/samba/homes/%u' in your [homes] section.
I thought of this, but as you said it's messy. On the other hand,
I'm always going to have to do something "special" for the class B
users to give them a "home share" directory.
> Solution 2:
> This solution assumes that the primary group of all of your class A
> users is 'classA' and the primary group of all of your class B users
> is 'classB'. It also assumes you have your smb.conf file stored at
> /usr/local/samba/lib/smb.conf and your user's real home directories
> are stored in /homes. Adjust accordingly for your actual setup.
> First create a new file called /usr/local/samba/lib/smb.conf.classA .
> It should contain:
> path = /home/%u
> Create a second file called /usr/local/samba/lib/smb.conf.classB .
> It should contain:
> path = /usr/local/samba/homes/%u
> Lastly, create a homes section that contains the following instead of
> a path statement:
> include = /usr/local/samba/lib/smb.conf.%g
> hope this helps.
I just tried a variation on this. Namely, I only created a new
smb.conf.classb file instead of both. If I understand the docs
correctly, smbd should just ignore any include line that points to
a file it can't find. So, this should include the proper path from
smb.conf.classb for my classb users and the default path of ~user
(from /etc/passwd) should be used for all other users since this
is the default path for the [homes] directive.
However, I couldn't get it to work. Having this include statement in
the smb.conf file broke the entire operation of samba. While testing
I couldn't even list the shares available on the server. When I
commented out the include line, operation went back to normal.
I don't get it; this should work. I don't know what I'm missing. Here
is what I tried in my smb.conf file:
comment = Home directories
browseable = no
; valid users = @tech7
include = /usr/local/samba/lib/smb.conf.%g
; browseable = yes
; path = /usr/local/samba/shares/home/%u
writeable = yes
create mode = 700
Note, the common group of "class B" users is "tech7" .
The comments are from earlier experiments. I then created the
with the contents:
path = /usr/local/samba/shares/home/%u
Running testparm on smb.conf yields strange results. It complains that
it can't get peername and that it can't find the file:
The problem might simply be that include can't be used in a share
context. I looked at the man page and it indicates that include can
only be used in the globals section.
Thanks very much for your help. I'll keep thinking about the problem
and see what I can come up with.
Brian L. Gentry
More information about the samba