3 |
- |
1 |
# This is the main Samba configuration file. You should read the
|
|
|
2 |
# smb.conf(5) manual page in order to understand the options listed
|
|
|
3 |
# here. Samba has a huge number of configurable options (perhaps too
|
|
|
4 |
# many!) most of which are not shown in this example
|
|
|
5 |
#
|
|
|
6 |
# For a step to step guide on installing, configuring and using samba,
|
|
|
7 |
# read the Samba-HOWTO-Collection. This may be obtained from:
|
|
|
8 |
# http://www.samba.org/samba/docs/Samba-HOWTO-Collection.pdf
|
|
|
9 |
#
|
|
|
10 |
# Many working examples of smb.conf files can be found in the
|
|
|
11 |
# Samba-Guide which is generated daily and can be downloaded from:
|
|
|
12 |
# http://www.samba.org/samba/docs/Samba-Guide.pdf
|
|
|
13 |
#
|
|
|
14 |
# Any line which starts with a ; (semi-colon) or a # (hash)
|
|
|
15 |
# is a comment and is ignored. In this example we will use a #
|
|
|
16 |
# for commentry and a ; for parts of the config file that you
|
|
|
17 |
# may wish to enable
|
|
|
18 |
#
|
|
|
19 |
# NOTE: Whenever you modify this file you should run the command "testparm"
|
|
|
20 |
# to check that you have not made any basic syntactic errors.
|
|
|
21 |
#
|
|
|
22 |
#---------------
|
|
|
23 |
# SELINUX NOTES:
|
|
|
24 |
#
|
|
|
25 |
# If you want to use the useradd/groupadd family of binaries please run:
|
|
|
26 |
# setsebool -P samba_domain_controller on
|
|
|
27 |
#
|
|
|
28 |
# If you want to share home directories via samba please run:
|
|
|
29 |
# setsebool -P samba_enable_home_dirs on
|
|
|
30 |
#
|
|
|
31 |
# If you create a new directory you want to share you should mark it as
|
|
|
32 |
# "samba_share_t" so that selinux will let you write into it.
|
|
|
33 |
# Make sure not to do that on system directories as they may already have
|
|
|
34 |
# been marked with othe SELinux labels.
|
|
|
35 |
#
|
|
|
36 |
# Use ls -ldZ /path to see which context a directory has
|
|
|
37 |
#
|
|
|
38 |
# Set labels only on directories you created!
|
|
|
39 |
# To set a label use the following: chcon -t samba_share_t /path
|
|
|
40 |
#
|
|
|
41 |
# If you need to share a system created directory you can use one of the
|
|
|
42 |
# following (read-only/read-write):
|
|
|
43 |
# setsebool -P samba_export_all_ro on
|
|
|
44 |
# or
|
|
|
45 |
# setsebool -P samba_export_all_rw on
|
|
|
46 |
#
|
|
|
47 |
# If you want to run scripts (preexec/root prexec/print command/...) please
|
|
|
48 |
# put them into the /var/lib/samba/scripts directory so that smbd will be
|
|
|
49 |
# allowed to run them.
|
|
|
50 |
# Make sure you COPY them and not MOVE them so that the right SELinux context
|
|
|
51 |
# is applied, to check all is ok use restorecon -R -v /var/lib/samba/scripts
|
|
|
52 |
#
|
|
|
53 |
#--------------
|
|
|
54 |
#
|
|
|
55 |
#======================= Global Settings =====================================
|
|
|
56 |
|
|
|
57 |
[global]
|
|
|
58 |
|
|
|
59 |
# ----------------------- Network Related Options -------------------------
|
|
|
60 |
#
|
|
|
61 |
# workgroup = NT-Domain-Name or Workgroup-Name, eg: MIDEARTH
|
|
|
62 |
#
|
|
|
63 |
# server string is the equivalent of the NT Description field
|
|
|
64 |
#
|
|
|
65 |
# netbios name can be used to specify a server name not tied to the hostname
|
|
|
66 |
#
|
|
|
67 |
# Interfaces lets you configure Samba to use multiple interfaces
|
|
|
68 |
# If you have multiple network interfaces then you can list the ones
|
|
|
69 |
# you want to listen on (never omit localhost)
|
|
|
70 |
#
|
|
|
71 |
# Hosts Allow/Hosts Deny lets you restrict who can connect, and you can
|
|
|
72 |
# specifiy it as a per share option as well
|
|
|
73 |
#
|
|
|
74 |
workgroup = MYGROUP
|
|
|
75 |
server string = Samba Server Version %v
|
|
|
76 |
|
|
|
77 |
; netbios name = MYSERVER
|
|
|
78 |
|
|
|
79 |
; interfaces = lo eth0 192.168.12.2/24 192.168.13.2/24
|
|
|
80 |
; hosts allow = 127. 192.168.12. 192.168.13.
|
|
|
81 |
|
|
|
82 |
# --------------------------- Logging Options -----------------------------
|
|
|
83 |
#
|
|
|
84 |
# Log File let you specify where to put logs and how to split them up.
|
|
|
85 |
#
|
|
|
86 |
# Max Log Size let you specify the max size log files should reach
|
|
|
87 |
|
|
|
88 |
# logs split per machine
|
|
|
89 |
log file = /var/log/samba/log.%m
|
|
|
90 |
# max 50KB per log file, then rotate
|
|
|
91 |
max log size = 50
|
|
|
92 |
|
|
|
93 |
# ----------------------- Standalone Server Options ------------------------
|
|
|
94 |
#
|
|
|
95 |
# Scurity can be set to user, share(deprecated) or server(deprecated)
|
|
|
96 |
#
|
|
|
97 |
# Backend to store user information in. New installations should
|
|
|
98 |
# use either tdbsam or ldapsam. smbpasswd is available for backwards
|
|
|
99 |
# compatibility. tdbsam requires no further configuration.
|
|
|
100 |
|
|
|
101 |
security = user
|
|
|
102 |
passdb backend = tdbsam
|
|
|
103 |
|
|
|
104 |
|
|
|
105 |
# ----------------------- Domain Members Options ------------------------
|
|
|
106 |
#
|
|
|
107 |
# Security must be set to domain or ads
|
|
|
108 |
#
|
|
|
109 |
# Use the realm option only with security = ads
|
|
|
110 |
# Specifies the Active Directory realm the host is part of
|
|
|
111 |
#
|
|
|
112 |
# Backend to store user information in. New installations should
|
|
|
113 |
# use either tdbsam or ldapsam. smbpasswd is available for backwards
|
|
|
114 |
# compatibility. tdbsam requires no further configuration.
|
|
|
115 |
#
|
|
|
116 |
# Use password server option only with security = server or if you can't
|
|
|
117 |
# use the DNS to locate Domain Controllers
|
|
|
118 |
# The argument list may include:
|
|
|
119 |
# password server = My_PDC_Name [My_BDC_Name] [My_Next_BDC_Name]
|
|
|
120 |
# or to auto-locate the domain controller/s
|
|
|
121 |
# password server = *
|
|
|
122 |
|
|
|
123 |
|
|
|
124 |
; security = domain
|
|
|
125 |
; passdb backend = tdbsam
|
|
|
126 |
; realm = MY_REALM
|
|
|
127 |
|
|
|
128 |
; password server = <NT-Server-Name>
|
|
|
129 |
|
|
|
130 |
# ----------------------- Domain Controller Options ------------------------
|
|
|
131 |
#
|
|
|
132 |
# Security must be set to user for domain controllers
|
|
|
133 |
#
|
|
|
134 |
# Backend to store user information in. New installations should
|
|
|
135 |
# use either tdbsam or ldapsam. smbpasswd is available for backwards
|
|
|
136 |
# compatibility. tdbsam requires no further configuration.
|
|
|
137 |
#
|
|
|
138 |
# Domain Master specifies Samba to be the Domain Master Browser. This
|
|
|
139 |
# allows Samba to collate browse lists between subnets. Don't use this
|
|
|
140 |
# if you already have a Windows NT domain controller doing this job
|
|
|
141 |
#
|
|
|
142 |
# Domain Logons let Samba be a domain logon server for Windows workstations.
|
|
|
143 |
#
|
|
|
144 |
# Logon Scrpit let yuou specify a script to be run at login time on the client
|
|
|
145 |
# You need to provide it in a share called NETLOGON
|
|
|
146 |
#
|
|
|
147 |
# Logon Path let you specify where user profiles are stored (UNC path)
|
|
|
148 |
#
|
|
|
149 |
# Various scripts can be used on a domain controller or stand-alone
|
|
|
150 |
# machine to add or delete corresponding unix accounts
|
|
|
151 |
#
|
|
|
152 |
; security = user
|
|
|
153 |
; passdb backend = tdbsam
|
|
|
154 |
|
|
|
155 |
; domain master = yes
|
|
|
156 |
; domain logons = yes
|
|
|
157 |
|
|
|
158 |
# the login script name depends on the machine name
|
|
|
159 |
; logon script = %m.bat
|
|
|
160 |
# the login script name depends on the unix user used
|
|
|
161 |
; logon script = %u.bat
|
|
|
162 |
; logon path = \\%L\Profiles\%u
|
|
|
163 |
# disables profiles support by specifing an empty path
|
|
|
164 |
; logon path =
|
|
|
165 |
|
|
|
166 |
; add user script = /usr/sbin/useradd "%u" -n -g users
|
|
|
167 |
; add group script = /usr/sbin/groupadd "%g"
|
|
|
168 |
; add machine script = /usr/sbin/useradd -n -c "Workstation (%u)" -M -d /nohome -s /bin/false "%u"
|
|
|
169 |
; delete user script = /usr/sbin/userdel "%u"
|
|
|
170 |
; delete user from group script = /usr/sbin/userdel "%u" "%g"
|
|
|
171 |
; delete group script = /usr/sbin/groupdel "%g"
|
|
|
172 |
|
|
|
173 |
|
|
|
174 |
# ----------------------- Browser Control Options ----------------------------
|
|
|
175 |
#
|
|
|
176 |
# set local master to no if you don't want Samba to become a master
|
|
|
177 |
# browser on your network. Otherwise the normal election rules apply
|
|
|
178 |
#
|
|
|
179 |
# OS Level determines the precedence of this server in master browser
|
|
|
180 |
# elections. The default value should be reasonable
|
|
|
181 |
#
|
|
|
182 |
# Preferred Master causes Samba to force a local browser election on startup
|
|
|
183 |
# and gives it a slightly higher chance of winning the election
|
|
|
184 |
; local master = no
|
|
|
185 |
; os level = 33
|
|
|
186 |
; preferred master = yes
|
|
|
187 |
|
|
|
188 |
#----------------------------- Name Resolution -------------------------------
|
|
|
189 |
# Windows Internet Name Serving Support Section:
|
|
|
190 |
# Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
|
|
|
191 |
#
|
|
|
192 |
# - WINS Support: Tells the NMBD component of Samba to enable it's WINS Server
|
|
|
193 |
#
|
|
|
194 |
# - WINS Server: Tells the NMBD components of Samba to be a WINS Client
|
|
|
195 |
#
|
|
|
196 |
# - WINS Proxy: Tells Samba to answer name resolution queries on
|
|
|
197 |
# behalf of a non WINS capable client, for this to work there must be
|
|
|
198 |
# at least one WINS Server on the network. The default is NO.
|
|
|
199 |
#
|
|
|
200 |
# DNS Proxy - tells Samba whether or not to try to resolve NetBIOS names
|
|
|
201 |
# via DNS nslookups.
|
|
|
202 |
|
|
|
203 |
; wins support = yes
|
|
|
204 |
; wins server = w.x.y.z
|
|
|
205 |
; wins proxy = yes
|
|
|
206 |
|
|
|
207 |
; dns proxy = yes
|
|
|
208 |
|
|
|
209 |
# --------------------------- Printing Options -----------------------------
|
|
|
210 |
#
|
|
|
211 |
# Load Printers let you load automatically the list of printers rather
|
|
|
212 |
# than setting them up individually
|
|
|
213 |
#
|
|
|
214 |
# Cups Options let you pass the cups libs custom options, setting it to raw
|
|
|
215 |
# for example will let you use drivers on your Windows clients
|
|
|
216 |
#
|
|
|
217 |
# Printcap Name let you specify an alternative printcap file
|
|
|
218 |
#
|
|
|
219 |
# You can choose a non default printing system using the Printing option
|
|
|
220 |
|
|
|
221 |
load printers = yes
|
|
|
222 |
cups options = raw
|
|
|
223 |
|
|
|
224 |
; printcap name = /etc/printcap
|
|
|
225 |
#obtain list of printers automatically on SystemV
|
|
|
226 |
; printcap name = lpstat
|
|
|
227 |
; printing = cups
|
|
|
228 |
|
|
|
229 |
# --------------------------- Filesystem Options ---------------------------
|
|
|
230 |
#
|
|
|
231 |
# The following options can be uncommented if the filesystem supports
|
|
|
232 |
# Extended Attributes and they are enabled (usually by the mount option
|
|
|
233 |
# user_xattr). Thess options will let the admin store the DOS attributes
|
|
|
234 |
# in an EA and make samba not mess with the permission bits.
|
|
|
235 |
#
|
|
|
236 |
# Note: these options can also be set just per share, setting them in global
|
|
|
237 |
# makes them the default for all shares
|
|
|
238 |
|
|
|
239 |
; map archive = no
|
|
|
240 |
; map hidden = no
|
|
|
241 |
; map read only = no
|
|
|
242 |
; map system = no
|
|
|
243 |
; store dos attributes = yes
|
|
|
244 |
|
|
|
245 |
|
|
|
246 |
#============================ Share Definitions ==============================
|
|
|
247 |
|
|
|
248 |
[homes]
|
|
|
249 |
comment = Home Directories
|
|
|
250 |
browseable = no
|
|
|
251 |
writable = yes
|
|
|
252 |
; valid users = %S
|
|
|
253 |
; valid users = MYDOMAIN\%S
|
|
|
254 |
|
|
|
255 |
[printers]
|
|
|
256 |
comment = All Printers
|
|
|
257 |
path = /var/spool/samba
|
|
|
258 |
browseable = no
|
|
|
259 |
guest ok = no
|
|
|
260 |
writable = no
|
|
|
261 |
printable = yes
|
|
|
262 |
|
|
|
263 |
# Un-comment the following and create the netlogon directory for Domain Logons
|
|
|
264 |
; [netlogon]
|
|
|
265 |
; comment = Network Logon Service
|
|
|
266 |
; path = /var/lib/samba/netlogon
|
|
|
267 |
; guest ok = yes
|
|
|
268 |
; writable = no
|
|
|
269 |
; share modes = no
|
|
|
270 |
|
|
|
271 |
|
|
|
272 |
# Un-comment the following to provide a specific roving profile share
|
|
|
273 |
# the default is to use the user's home directory
|
|
|
274 |
; [Profiles]
|
|
|
275 |
; path = /var/lib/samba/profiles
|
|
|
276 |
; browseable = no
|
|
|
277 |
; guest ok = yes
|
|
|
278 |
|
|
|
279 |
|
|
|
280 |
# A publicly accessible directory, but read only, except for people in
|
|
|
281 |
# the "staff" group
|
|
|
282 |
; [public]
|
|
|
283 |
; comment = Public Stuff
|
|
|
284 |
; path = /home/samba
|
|
|
285 |
; public = yes
|
|
|
286 |
; writable = yes
|
|
|
287 |
; printable = no
|
|
|
288 |
; write list = +staff
|