Using Host-Based Protection
In many installations of Samba, the greatest threat comes from outside
your immediate network. By default, Samba accepts connections from
any host, which means that if you run an insecure version of Samba on
a host that is directly connected to the Internet, you can be
especially vulnerable.
One of the simplest fixes in this case is to use the
hosts allow and
hosts deny options in the Samba smb.conf configuration file to
allow access to your server only from a specific range of hosts. An example might be:
hosts allow = 127.0.0.1 192.168.2.0/24 192.168.3.0/24
|
hosts deny = 0.0.0.0/0
|
The above will allow SMB connections only from localhost (your own
computer) and from the two private networks 192.168.2 and 192.168.3. All other
connections will be refused as soon as the client sends its first packet. The refusal
will be marked as not listening on called name error.
|