Samba Quickies


Section index - KB index

My Windows boxes can't see my Samba server

Make sure you define wins support = yes in the ~[global] section of /etc/samba/smb.conf. This tells samba to become the WINS server for the network.

Insert the IP address of your Samba server in the WINS section of the TCP/IP protocol on each Windows machine.

If you are using DHCP, you can also pass the WINS server IP to the clients via the 'netbios-name-servers' option.

Note: It is also useful to make sure all your Windows clients only use the TCP/IP protocol. If they are running the NetBEUI protocol they can hold a master browser election without your Samba server participating.

How to make a share for a group of users

First you must find a suitable base for your shares; one that the security program msec will not interfere with.

If you don't understand msec, it sometimes has a nasty habit of clobbering your directory permissions. Hint: check your partition sizes with

du -h

WHO: Create a group for these users:

As root:

groupadd accounting

Now with your favorite way, add users to this group.


I use a separate partition mounted off of the / partition. If you don't have this you could create a directory off of /home, say /home/shares.

For this example, we'll say you are using /home/shares.

As root:

mkdir -m 751 /home/shares
mkdir -m 2770 /home/shares/accounting
chgrp accounting /home/shares/accounting

And now add your share to /etc/samba/smb.conf:

        comment = \for the accouting group
        path = /home/shares/accouting
        browseable = no
        guest ok = no
        valid users = @accounting
        writeable = no
        write list = @accounting
        create mask = 771
        directory mask = 770
        map hidden = yes
        map archive = yes
        map system = yes
        available = yes

  • browseable = no tells Samba that this share will not be visable in the Network Neighborhood. Change this to yes if you want this share visible.
  • map hidden = yes, map archive = yes, and map system = yes tell Samba to respectively honor these Windows file attributes.

Now make the share available:

As root:

service smb reload

What should I put in the homes section

Decide where each user's Windows home directory will be located. I use /home/user/windows.m and my users map the share as their M: drive.

For each user, create their directory as follows substituting the real user's name for USER.

As root:

mkdir -m 2770 /home/USER/windows.m
chmod USER.USER /home/USER/windows.m

Optional: Add this directory to /etc/skel so that it will automatically be created when you create a new user.

mkdir -m 2770 /etc/skel/windows.m

Now change the ~[homes] section to:

        comment = Home Directories
        path = /home/%U/windows.m
        available = yes
        browseable = no
        valid users = %S
        writable = yes
        \public = no
        only user = no
        directory mask = 770
        create mask = 771
        map hidden = yes
        map archive = yes
        map system = yes
        fake oplocks = yes

Notes: Since only one user will be accessing this share at a time, fake oplocks = yes is safe and will speed up access to the home shares.
KB - Samba Quickies
Version 1.18 last modified by chua seng chan on 19/05/2006 at 06:38




Creator: DoomedTX on 2004/05/28 15:09
(c) Mandriva 2007