Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to block access to some Samba shares from a certain machine, but somehow I can't get it to work: the machine can still access the shares, and I did restart and reload the samba daemon.

Here is a part of my configuration:

    security = share
    hosts allow =
    interfaces = eth1
    bind interfaces only = yes
    hosts deny =
    encrypt passwords = yes
    guest ok = yes

The shares themselves look like this:

    comment = Example
    path = /foo/bar
    read only = No
    guest ok = yes

What am I doing wrong here?

share|improve this question
Have you tried 192.168.1. instead of ? Also which version of Samba are you using ? Does your config apply to [global] ? – drcelus Jun 22 '12 at 10:42
tried that now, does not seem to make a difference. Version is 3.5.10-114.fc12 and yes it is in the [global] section – datadevil Jun 22 '12 at 11:29

Found the answer, at least a working solution:

I removed the hosts deny line, and changed that hosts allow as follows:

    hosts allow = 192.168.1. EXCEPT
share|improve this answer

Correction: For the machines you want to block access to set the "browseable= no". This field may vary depending on the version of Samba your using

share|improve this answer
can you please explain? How do I set browseable=no for specific machines? – datadevil Jun 28 '12 at 8:01
sorry for the delay. at the very bottom of the /etc/smb.conf file you should add the browseable=no option. For example [host ] \\ My example of a machine path = /home/host writable = yes valid users = <<browsable = no >>> add this field for each machine listed in you config file that you want to block admin users = public = yes guest ok = yes force user = nobody create mask = 777 directory mask = 777 – Al_ Aug 23 '12 at 3:38

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.