summaryrefslogtreecommitdiff
path: root/docs/manpages/smb.conf.5
blob: 465a2668617466f0719c49e833fb9231a0e92e5f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
.\"Generated by db2man.xsl. Don't modify this, modify the source.
.de Sh \" Subsection
.br
.if t .Sp
.ne 5
.PP
\fB\\$1\fR
.PP
..
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Ip \" List item
.br
.ie \\n(.$>=3 .ne \\$3
.el .ne 3
.IP "\\$1" \\$2
..
.TH "SMB.CONF" 5 "" "" ""
.SH NAME
smb.conf \- The configuration file for the Samba suite
.SH "SYNOPSIS"

.PP
The \fIsmb\&.conf\fR file is a configuration file for the Samba suite\&. \fIsmb\&.conf\fR contains runtime configuration information for the Samba programs\&. The \fIsmb\&.conf\fR file is designed to be configured and administered by the \fBswat\fR(8) program\&. The complete description of the file format and possible parameters held within are here for reference purposes\&.

.SH "FILE FORMAT"

.PP
The file consists of sections and parameters\&. A section begins with the name of the section in square brackets and continues until the next section begins\&. Sections contain parameters of the form

.PP
\fIname\fR = \fIvalue \fR

.PP
The file is line-based - that is, each newline-terminated line represents either a comment, a section name or a parameter\&.

.PP
Section and parameter names are not case sensitive\&.

.PP
Only the first equals sign in a parameter is significant\&. Whitespace before or after the first equals sign is discarded\&. Leading, trailing and internal whitespace in section and parameter names is irrelevant\&. Leading and trailing whitespace in a parameter value is discarded\&. Internal whitespace within a parameter value is retained verbatim\&.

.PP
Any line beginning with a semicolon (';') or a hash ('#') character is ignored, as are lines containing only whitespace\&.

.PP
Any line ending in a '\\' is continued on the next line in the customary UNIX fashion\&.

.PP
The values following the equals sign in parameters are all either a string (no quotes needed) or a boolean, which may be given as yes/no, 0/1 or true/false\&. Case is not significant in boolean values, but is preserved in string values\&. Some items such as create modes are numeric\&.

.SH "SECTION DESCRIPTIONS"

.PP
Each section in the configuration file (except for the [global] section) describes a shared resource (known as a "share")\&. The section name is the name of the shared resource and the parameters within the section define the shares attributes\&.

.PP
There are three special sections, [global], [homes] and [printers], which are described under \fBspecial sections\fR\&. The following notes apply to ordinary section descriptions\&.

.PP
A share consists of a directory to which access is being given plus a description of the access rights which are granted to the user of the service\&. Some housekeeping options are also specifiable\&.

.PP
Sections are either file share services (used by the client as an extension of their native file systems) or printable services (used by the client to access print services on the host running the server)\&.

.PP
Sections may be designated \fBguest\fR services, in which case no password is required to access them\&. A specified UNIX \fBguest account\fR is used to define access privileges in this case\&.

.PP
Sections other than guest services will require a password to access them\&. The client provides the username\&. As older clients only provide passwords and not usernames, you may specify a list of usernames to check against the password using the "user =" option in the share definition\&. For modern clients such as Windows 95/98/ME/NT/2000, this should not be necessary\&.

.PP
Note that the access rights granted by the server are masked by the access rights granted to the specified or guest UNIX user by the host system\&. The server does not grant more access than the host system grants\&.

.PP
The following sample section defines a file space share\&. The user has write access to the path \fI/home/bar\fR\&. The share is accessed via the share name "foo":
.nf


[foo]
	path = /home/bar
	read only = no

.fi

.PP
The following sample section defines a printable share\&. The share is readonly, but printable\&. That is, the only write access permitted is via calls to open, write to and close a spool file\&. The \fBguest ok\fR parameter means access will be permitted as the default guest user (specified elsewhere):
.nf


[aprinter]
	path = /usr/spool/public
	read only = yes
	printable = yes
	guest ok = yes

.fi

.SH "SPECIAL SECTIONS"

.SS "The [global] section"

.PP
parameters in this section apply to the server as a whole, or are defaults for sections which do not specifically define certain items\&. See the notes under PARAMETERS for more information\&.

.SS "The [homes] section"

.PP
If a section called homes is included in the configuration file, services connecting clients to their home directories can be created on the fly by the server\&.

.PP
When the connection request is made, the existing sections are scanned\&. If a match is found, it is used\&. If no match is found, the requested section name is treated as a user name and looked up in the local password file\&. If the name exists and the correct password has been given, a share is created by cloning the [homes] section\&.

.PP
Some modifications are then made to the newly created share:

.TP 3
\(bu
The share name is changed from homes to the located username\&.

.TP
\(bu
If no path was given, the path is set to the user's home directory\&.

.LP

.PP
If you decide to use a \fBpath =\fR line in your [homes] section then you may find it useful to use the %S macro\&. For example :

.PP
\fBpath = /data/pchome/%S\fR

.PP
would be useful if you have different home directories for your PCs than for UNIX access\&.

.PP
This is a fast and simple way to give a large number of clients access to their home directories with a minimum of fuss\&.

.PP
A similar process occurs if the requested section name is "homes", except that the share name is not changed to that of the requesting user\&. This method of using the [homes] section works well if different users share a client PC\&.

.PP
The [homes] section can specify all the parameters a normal service section can specify, though some make more sense than others\&. The following is a typical and suitable [homes] section:
.nf


[homes]
	read only = no

.fi

.PP
An important point is that if guest access is specified in the [homes] section, all home directories will be visible to all clients \fBwithout a password\fR\&. In the very unlikely event that this is actually desirable, it would be wise to also specify \fBread only access\fR\&.

.PP
Note that the \fBbrowseable\fR flag for auto home directories will be inherited from the global browseable flag, not the [homes] browseable flag\&. This is useful as it means setting \fBbrowseable = no\fR in the [homes] section will hide the [homes] share but make any auto home directories visible\&.

.SS "The [printers] section"

.PP
This section works like [homes], but for printers\&.

.PP
If a [printers] section occurs in the configuration file, users are able to connect to any printer specified in the local host's printcap file\&.

.PP
When a connection request is made, the existing sections are scanned\&. If a match is found, it is used\&. If no match is found, but a [homes] section exists, it is used as described above\&. Otherwise, the requested section name is treated as a printer name and the appropriate printcap file is scanned to see if the requested section name is a valid printer share name\&. If a match is found, a new printer share is created by cloning the [printers] section\&.

.PP
A few modifications are then made to the newly created share:

.TP 3
\(bu
The share name is set to the located printer name

.TP
\(bu
If no printer name was given, the printer name is set to the located printer name

.TP
\(bu
If the share does not permit guest access and no username was given, the username is set to the located printer name\&.

.LP

.PP
Note that the [printers] service MUST be printable - if you specify otherwise, the server will refuse to load the configuration file\&.

.PP
Typically the path specified would be that of a world-writeable spool directory with the sticky bit set on it\&. A typical [printers] entry would look like this:
.nf

[printers]
	path = /usr/spool/public
	guest ok = yes
	printable = yes 
.fi

.PP
All aliases given for a printer in the printcap file are legitimate printer names as far as the server is concerned\&. If your printing subsystem doesn't work like that, you will have to set up a pseudo-printcap\&. This is a file consisting of one or more lines like this:
.nf


alias|alias|alias|alias\&.\&.\&.    

.fi

.PP
Each alias should be an acceptable printer name for your printing subsystem\&. In the [global] section, specify the new file as your printcap\&. The server will then only recognize names found in your pseudo-printcap, which of course can contain whatever aliases you like\&. The same technique could be used simply to limit access to a subset of your local printers\&.

.PP
An alias, by the way, is defined as any component of the first entry of a printcap record\&. Records are separated by newlines, components (if there are more than one) are separated by vertical bar symbols ('|')\&.

.RS
.Sh "Note"

.PP
On SYSV systems which use lpstat to determine what printers are defined on the system you may be able to use "printcap name = lpstat" to automatically obtain a list of printers\&. See the "printcap name" option for more details\&.

.RE

.SH "PARAMETERS"

.PP
parameters define the specific attributes of sections\&.

.PP
Some parameters are specific to the [global] section (e\&.g\&., \fBsecurity\fR)\&. Some parameters are usable in all sections (e\&.g\&., \fBcreate mode\fR)\&. All others are permissible only in normal sections\&. For the purposes of the following descriptions the [homes] and [printers] sections will be considered normal\&. The letter \fBG\fR in parentheses indicates that a parameter is specific to the [global] section\&. The letter \fBS\fR indicates that a parameter can be specified in a service specific section\&. Note that all \fBS\fR parameters can also be specified in the [global] section - in which case they will define the default behavior for all services\&.

.PP
parameters are arranged here in alphabetical order - this may not create best bedfellows, but at least you can find them! Where there are synonyms, the preferred synonym is described, others refer to the preferred synonym\&.

.SH "VARIABLE SUBSTITUTIONS"

.PP
Many of the strings that are settable in the config file can take substitutions\&. For example the option "path = /tmp/%u" would be interpreted as "path = /tmp/john" if the user connected with the username john\&.

.PP
These substitutions are mostly noted in the descriptions below, but there are some general substitutions which apply whenever they might be relevant\&. These are:

.TP
%U
session user name (the user name that the client wanted, not necessarily the same as the one they got)\&.


.TP
%G
primary group name of %U\&.


.TP
%h
the Internet hostname that Samba is running on\&.


.TP
%m
the NetBIOS name of the client machine (very useful)\&.


.TP
%L
the NetBIOS name of the server\&. This allows you to change your config based on what the client calls you\&. Your server can have a "dual personality"\&.


Note that this parameter is not available when Samba listens on port 445, as clients no longer send this information


.TP
%M
the Internet name of the client machine\&.


.TP
%R
the selected protocol level after protocol negotiation\&. It can be one of CORE, COREPLUS, LANMAN1, LANMAN2 or NT1\&.


.TP
%d
The process id of the current server process\&.


.TP
%a
the architecture of the remote machine\&. Only some are recognized, and those may not be 100% reliable\&. It currently recognizes Samba, WfWg, Win95, WinNT and Win2k\&. Anything else will be known as "UNKNOWN"\&. If it gets it wrong then sending a level 3 log to samba@samba\&.org should allow it to be fixed\&.


.TP
%I
The IP address of the client machine\&.


.TP
%T
the current date and time\&.


.TP
%D
Name of the domain or workgroup of the current user\&.


.TP
%$(\fIenvvar\fR)
The value of the environment variable \fIenvar\fR\&.


.PP
The following substitutes apply only to some configuration options(only those that are used when a connection has been established):

.TP
%S
the name of the current service, if any\&.


.TP
%P
the root directory of the current service, if any\&.


.TP
%u
user name of the current service, if any\&.


.TP
%g
primary group name of %u\&.


.TP
%H
the home directory of the user given by %u\&.


.TP
%N
the name of your NIS home directory server\&. This is obtained from your NIS auto\&.map entry\&. If you have not compiled Samba with the \fB--with-automount\fR option then this value will be the same as %L\&.


.TP
%p
the path of the service's home directory, obtained from your NIS auto\&.map entry\&. The NIS auto\&.map entry is split up as "%N:%p"\&.


.PP
There are some quite creative things that can be done with these substitutions and other smb\&.conf options\&.

.SH "NAME MANGLING"

.PP
Samba supports "name mangling" so that DOS and Windows clients can use files that don't conform to the 8\&.3 format\&. It can also be set to adjust the case of 8\&.3 format filenames\&.

.PP
There are several options that control the way mangling is performed, and they are grouped here rather than listed separately\&. For the defaults look at the output of the testparm program\&.

.PP
All of these options can be set separately for each service (or globally, of course)\&.

.PP
The options are:

.TP
mangle case = yes/no
controls if names that have characters that aren't of the "default" case are mangled\&. For example, if this is yes then a name like "Mail" would be mangled\&. Default \fBno\fR\&.


.TP
case sensitive = yes/no
controls whether filenames are case sensitive\&. If they aren't then Samba must do a filename search and match on passed names\&. Default \fBno\fR\&.


.TP
default case = upper/lower
controls what the default case is for new filenames\&. Default \fBlower\fR\&.


.TP
preserve case = yes/no
controls if new files are created with the case that the client passes, or if they are forced to be the "default" case\&. Default \fByes\fR\&.


.TP
short preserve case = yes/no
controls if new files which conform to 8\&.3 syntax, that is all in upper case and of suitable length, are created upper case, or if they are forced to be the "default" case\&. This option can be use with "preserve case = yes" to permit long filenames to retain their case, while short names are lowercased\&. Default \fByes\fR\&.


.PP
By default, Samba 3\&.0 has the same semantics as a Windows NT server, in that it is case insensitive but case preserving\&.

.SH "NOTE ABOUT USERNAME/PASSWORD VALIDATION"

.PP
There are a number of ways in which a user can connect to a service\&. The server uses the following steps in determining if it will allow a connection to a specified service\&. If all the steps fail, then the connection request is rejected\&. However, if one of the steps succeeds, then the following steps are not checked\&.

.PP
If the service is marked "guest only = yes" and the server is running with share-level security ("security = share") then steps 1 to 5 are skipped\&.

.TP 3
1.
If the client has passed a username/password pair and that username/password pair is validated by the UNIX system's password programs then the connection is made as that username\&. Note that this includes the \\\\server\\service%\fIusername\fR method of passing a username\&.

.TP
2.
If the client has previously registered a username with the system and now supplies a correct password for that username then the connection is allowed\&.

.TP
3.
The client's NetBIOS name and any previously used user names are checked against the supplied password, if they match then the connection is allowed as the corresponding user\&.

.TP
4.
If the client has previously validated a username/password pair with the server and the client has passed the validation token then that username is used\&.

.TP
5.
If a "user = " field is given in the \fIsmb\&.conf\fR file for the service and the client has supplied a password, and that password matches (according to the UNIX system's password checking) with one of the usernames from the "user =" field then the connection is made as the username in the "user =" line\&. If one of the username in the "user =" list begins with a '@' then that name expands to a list of names in the group of the same name\&.

.TP
6.
If the service is a guest service then a connection is made as the username given in the "guest account =" for the service, irrespective of the supplied password\&.

.LP

.SH "COMPLETE LIST OF GLOBAL PARAMETERS"

.PP
Here is a list of all global parameters\&. See the section of each parameter for details\&. Note that some are synonyms\&.

.TP 3
.LP

.SH "COMPLETE LIST OF SERVICE PARAMETERS"

.PP
Here is a list of all service parameters\&. See the section on each parameter for details\&. Note that some are synonyms\&.

.TP 3
.LP

.SH "EXPLANATION OF EACH PARAMETER"

.SH "WARNINGS"

.PP
Although the configuration file permits service names to contain spaces, your client software may not\&. Spaces will be ignored in comparisons anyway, so it shouldn't be a problem - but be aware of the possibility\&.

.PP
On a similar note, many clients - especially DOS clients - limit service names to eight characters\&. \fBsmbd\fR(8) has no such limitation, but attempts to connect from such clients will fail if they truncate the service names\&. For this reason you should probably keep your service names down to eight characters in length\&.

.PP
Use of the [homes] and [printers] special sections make life for an administrator easy, but the various combinations of default attributes can be tricky\&. Take extreme care when designing these sections\&. In particular, ensure that the permissions on spool directories are correct\&.

.SH "VERSION"

.PP
This man page is correct for version 3\&.0 of the Samba suite\&.

.SH "SEE ALSO"

.PP
\fBsamba\fR(7), \fBsmbpasswd\fR(8), \fBswat\fR(8), \fBsmbd\fR(8), \fBnmbd\fR(8), \fBsmbclient\fR(1), \fBnmblookup\fR(1), \fBtestparm\fR(1), \fBtestprns\fR(1)\&.

.SH "AUTHOR"

.PP
The original Samba software and related utilities were created by Andrew Tridgell\&. Samba is now developed by the Samba Team as an Open Source project similar to the way the Linux kernel is developed\&.

.PP
The original Samba man pages were written by Karl Auer\&. The man page sources were converted to YODL format (another excellent piece of Open Source software, available at ftp://ftp\&.icce\&.rug\&.nl/pub/unix/) and updated for the Samba 2\&.0 release by Jeremy Allison\&. The conversion to DocBook for Samba 2\&.2 was done by Gerald Carter\&. The conversion to DocBook XML 4\&.2 for Samba 3\&.0 was done by Alexander Bokovoy\&.