General Linux > Samba > Issue
<<
72 of 98
>>
Issue:
How can I restrict access in Samba?
Resolution:
In Samba you can restrict access via TCP/IP and/or via users/groups. The
hosts allow field can be used in the
[global] section to limit access via TCP/IP to the entire Samba server. This option can also be used on a per share basis.
You can restrict access via users/groups on a per share basis. The example below shows a bare bones smb.conf file that only allows traffic from the 10.0.0.0/255.255.255.255 network, and has more detailed access restrictions on its shares. In this case the
valid users parameter is used to restrict access via users/groups. Notice that group names are prepended with an @ symbol.
/etc/samba/smb.conf
[global]
workgroup = WORKGROUP
netbios name = LOCALHOST
security = share
hosts allow = 127.0.0. 10.
[share1]
comment = First Share
path = /home/share1
#bob janet and all members of groupa are permitted access
valid users = bob janet @groupa
#only machines with 10.0.0.5, 10.2.5.10, and 10.0.1.1-255 are allowed
hosts allow = 10.0.0.5 10.2.5.10 10.0.1.
|
General Linux
>
Samba
> Issue
<<
72
of
98
>>