| 1 |
<samba:parameter name="hosts allow" |
| 2 |
context="S" |
| 3 |
type="cmdlist" |
| 4 |
xmlns:samba="http://www.samba.org/samba/DTD/samba-doc"> |
| 5 |
<synonym>allow hosts</synonym> |
| 6 |
<description> |
| 7 |
<para>A synonym for this parameter is <smbconfoption name="allow hosts"/>.</para> |
| 8 |
|
| 9 |
<para>This parameter is a comma, space, or tab delimited |
| 10 |
set of hosts which are permitted to access a service.</para> |
| 11 |
|
| 12 |
<para>If specified in the [global] section then it will |
| 13 |
apply to all services, regardless of whether the individual |
| 14 |
service has a different setting.</para> |
| 15 |
|
| 16 |
<para>You can specify the hosts by name or IP number. For |
| 17 |
example, you could restrict access to only the hosts on a |
| 18 |
Class C subnet with something like <command>allow hosts = 150.203.5.</command>. |
| 19 |
The full syntax of the list is described in the man |
| 20 |
page <filename>hosts_access(5)</filename>. Note that this man |
| 21 |
page may not be present on your system, so a brief description will |
| 22 |
be given here also.</para> |
| 23 |
|
| 24 |
<para>Note that the localhost address 127.0.0.1 will always |
| 25 |
be allowed access unless specifically denied by a <smbconfoption name="hosts deny"/> option.</para> |
| 26 |
|
| 27 |
<para>You can also specify hosts by network/netmask pairs and |
| 28 |
by netgroup names if your system supports netgroups. The |
| 29 |
<emphasis>EXCEPT</emphasis> keyword can also be used to limit a |
| 30 |
wildcard list. The following examples may provide some help:</para> |
| 31 |
|
| 32 |
<para>Example 1: allow all IPs in 150.203.*.*; except one</para> |
| 33 |
|
| 34 |
<para><command moreinfo="none">hosts allow = 150.203. EXCEPT 150.203.6.66</command></para> |
| 35 |
|
| 36 |
<para>Example 2: allow hosts that match the given network/netmask</para> |
| 37 |
|
| 38 |
<para><command moreinfo="none">hosts allow = 150.203.15.0/255.255.255.0</command></para> |
| 39 |
|
| 40 |
<para>Example 3: allow a couple of hosts</para> |
| 41 |
|
| 42 |
<para><command moreinfo="none">hosts allow = lapland, arvidsjaur</command></para> |
| 43 |
|
| 44 |
<para>Example 4: allow only hosts in NIS netgroup "foonet", but |
| 45 |
deny access from one particular host</para> |
| 46 |
|
| 47 |
<para><command moreinfo="none">hosts allow = @foonet</command></para> |
| 48 |
|
| 49 |
<para><command moreinfo="none">hosts deny = pirate</command></para> |
| 50 |
|
| 51 |
<note><para>Note that access still requires suitable user-level passwords.</para></note> |
| 52 |
|
| 53 |
<para>See <citerefentry><refentrytitle>testparm</refentrytitle> |
| 54 |
<manvolnum>1</manvolnum></citerefentry> for a way of testing your host access |
| 55 |
to see if it does what you expect.</para> |
| 56 |
|
| 57 |
|
| 58 |
</description> |
| 59 |
|
| 60 |
<value type="example">150.203.5. myhost.mynet.edu.au</value> |
| 61 |
<value type="default"><comment>none (i.e., all hosts permitted access)</comment></value> |
| 62 |
</samba:parameter> |