Account Links: Cart | Your Account | Logout

Skip to content

Red Hat Knowledgebase

Red Hat Knowledgebase Search:

Updated Within the Last:

New Solutions within the last day New Solutions within the last week New Solutions within the last month

Browse by topics:


Click to View a Topic
General Linux > Samba > Issue <<  72 of 98 >>

Solution Tools:


Email a Solution Postcard Printer version Submit a comment on this answer Update notifications Request an answer Back

Article Reference

Article ID: 2356
Last update: 07-01-04
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.


How well did this entry answer your question?


good wrong incomplete out of date
General Linux > Samba > Issue <<   72  of  98  >>