1 | <refentry id="smb.conf.5" xmlns:xi="http://www.w3.org/2003/XInclude"
|
---|
2 | xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
|
---|
3 |
|
---|
4 | <refmeta>
|
---|
5 | <refentrytitle>smb.conf</refentrytitle>
|
---|
6 | <manvolnum>5</manvolnum>
|
---|
7 | <refmiscinfo class="source">Samba</refmiscinfo>
|
---|
8 | <refmiscinfo class="manual">File Formats and Conventions</refmiscinfo>
|
---|
9 | <refmiscinfo class="version">4.4</refmiscinfo>
|
---|
10 | </refmeta>
|
---|
11 |
|
---|
12 |
|
---|
13 | <refnamediv>
|
---|
14 | <refname>smb.conf</refname>
|
---|
15 | <refpurpose>The configuration file for the Samba suite</refpurpose>
|
---|
16 | </refnamediv>
|
---|
17 |
|
---|
18 | <refsect1>
|
---|
19 | <title>SYNOPSIS</title>
|
---|
20 |
|
---|
21 | <para>
|
---|
22 | The <filename moreinfo="none">smb.conf</filename> file is a configuration file for the Samba suite. <filename
|
---|
23 | moreinfo="none">smb.conf</filename> contains runtime configuration information for the Samba programs. The
|
---|
24 | complete description of the file format and possible parameters held within are here for reference purposes.
|
---|
25 | </para>
|
---|
26 | </refsect1>
|
---|
27 |
|
---|
28 | <refsect1 id="FILEFORMATSECT">
|
---|
29 | <title>FILE FORMAT</title>
|
---|
30 |
|
---|
31 | <para>
|
---|
32 | The file consists of sections and parameters. A section begins with the name of the section in square brackets
|
---|
33 | and continues until the next section begins. Sections contain parameters of the form:
|
---|
34 | <programlisting>
|
---|
35 | <replaceable>name</replaceable> = <replaceable>value </replaceable>
|
---|
36 | </programlisting>
|
---|
37 | </para>
|
---|
38 |
|
---|
39 | <para>
|
---|
40 | The file is line-based - that is, each newline-terminated line represents either a comment, a section name or
|
---|
41 | a parameter.
|
---|
42 | </para>
|
---|
43 |
|
---|
44 | <para>Section and parameter names are not case sensitive.</para>
|
---|
45 |
|
---|
46 | <para>
|
---|
47 | Only the first equals sign in a parameter is significant. Whitespace before or after the first equals sign is
|
---|
48 | discarded. Leading, trailing and internal whitespace in section and parameter names is irrelevant. Leading
|
---|
49 | and trailing whitespace in a parameter value is discarded. Internal whitespace within a parameter value is
|
---|
50 | retained verbatim.
|
---|
51 | </para>
|
---|
52 |
|
---|
53 | <para>
|
---|
54 | Any line beginning with a semicolon (<quote>;</quote>) or a hash (<quote>#</quote>)
|
---|
55 | character is ignored, as are lines containing only whitespace.
|
---|
56 | </para>
|
---|
57 |
|
---|
58 | <para>
|
---|
59 | Any line ending in a <quote><literal>\</literal></quote> is continued on the next line in the customary UNIX fashion.
|
---|
60 | </para>
|
---|
61 |
|
---|
62 | <para>
|
---|
63 | The values following the equals sign in parameters are all either a string (no quotes needed) or a boolean,
|
---|
64 | which may be given as yes/no, 1/0 or true/false. Case is not significant in boolean values, but is preserved
|
---|
65 | in string values. Some items such as create masks are numeric.
|
---|
66 | </para>
|
---|
67 |
|
---|
68 | </refsect1>
|
---|
69 |
|
---|
70 | <refsect1>
|
---|
71 | <title>SECTION DESCRIPTIONS</title>
|
---|
72 |
|
---|
73 | <para>
|
---|
74 | Each section in the configuration file (except for the [global] section) describes a shared resource (known as
|
---|
75 | a <quote>share</quote>). The section name is the name of the shared resource and the parameters within the
|
---|
76 | section define the shares attributes.
|
---|
77 | </para>
|
---|
78 |
|
---|
79 | <para>
|
---|
80 | There are three special sections, [global], [homes] and [printers], which are described under
|
---|
81 | <emphasis>special sections</emphasis>. The following notes apply to ordinary section descriptions.
|
---|
82 | </para>
|
---|
83 |
|
---|
84 | <para>
|
---|
85 | A share consists of a directory to which access is being given plus a description of the access rights
|
---|
86 | which are granted to the user of the service. Some housekeeping options are also specifiable.
|
---|
87 | </para>
|
---|
88 |
|
---|
89 | <para>
|
---|
90 | Sections are either file share services (used by the client as an extension of their native file systems)
|
---|
91 | or printable services (used by the client to access print services on the host running the server).
|
---|
92 | </para>
|
---|
93 |
|
---|
94 | <para>
|
---|
95 | Sections may be designated <emphasis>guest</emphasis> services, in which case no password is required to
|
---|
96 | access them. A specified UNIX <emphasis>guest account</emphasis> is used to define access privileges in this
|
---|
97 | case.
|
---|
98 | </para>
|
---|
99 |
|
---|
100 | <para>
|
---|
101 | Sections other than guest services will require a password to access them. The client provides the
|
---|
102 | username. As older clients only provide passwords and not usernames, you may specify a list of usernames to
|
---|
103 | check against the password using the <literal>user =</literal> option in the share definition. For modern clients
|
---|
104 | such as Windows 95/98/ME/NT/2000, this should not be necessary.
|
---|
105 | </para>
|
---|
106 |
|
---|
107 | <para>
|
---|
108 | The access rights granted by the server are masked by the access rights granted to the specified or guest
|
---|
109 | UNIX user by the host system. The server does not grant more access than the host system grants.
|
---|
110 | </para>
|
---|
111 |
|
---|
112 | <para>
|
---|
113 | The following sample section defines a file space share. The user has write access to the path <filename
|
---|
114 | moreinfo="none">/home/bar</filename>. The share is accessed via the share name <literal>foo</literal>:
|
---|
115 | <programlisting>
|
---|
116 | <smbconfsection name="[foo]"/>
|
---|
117 | <smbconfoption name="path">/home/bar</smbconfoption>
|
---|
118 | <smbconfoption name="read only">no</smbconfoption>
|
---|
119 | </programlisting>
|
---|
120 | </para>
|
---|
121 |
|
---|
122 | <para>
|
---|
123 | The following sample section defines a printable share. The share is read-only, but printable. That is,
|
---|
124 | the only write access permitted is via calls to open, write to and close a spool file. The <emphasis>guest
|
---|
125 | ok</emphasis> parameter means access will be permitted as the default guest user (specified elsewhere):
|
---|
126 | <programlisting>
|
---|
127 | <smbconfsection name="[aprinter]"/>
|
---|
128 | <smbconfoption name="path">/usr/spool/public</smbconfoption>
|
---|
129 | <smbconfoption name="read only">yes</smbconfoption>
|
---|
130 | <smbconfoption name="printable">yes</smbconfoption>
|
---|
131 | <smbconfoption name="guest ok">yes</smbconfoption>
|
---|
132 | </programlisting>
|
---|
133 | </para>
|
---|
134 |
|
---|
135 | </refsect1>
|
---|
136 |
|
---|
137 | <refsect1>
|
---|
138 | <title>SPECIAL SECTIONS</title>
|
---|
139 |
|
---|
140 | <refsect2>
|
---|
141 | <title>The [global] section</title>
|
---|
142 |
|
---|
143 | <para>
|
---|
144 | Parameters in this section apply to the server as a whole, or are defaults for sections that do not
|
---|
145 | specifically define certain items. See the notes under PARAMETERS for more information.
|
---|
146 | </para>
|
---|
147 | </refsect2>
|
---|
148 |
|
---|
149 | <refsect2 id="HOMESECT">
|
---|
150 | <title>The [homes] section</title>
|
---|
151 |
|
---|
152 | <para>
|
---|
153 | If a section called [homes] is included in the configuration file, services connecting clients
|
---|
154 | to their home directories can be created on the fly by the server.
|
---|
155 | </para>
|
---|
156 |
|
---|
157 | <para>
|
---|
158 | When the connection request is made, the existing sections are scanned. If a match is found, it is
|
---|
159 | used. If no match is found, the requested section name is treated as a username and looked up in the local
|
---|
160 | password file. If the name exists and the correct password has been given, a share is created by cloning the
|
---|
161 | [homes] section.
|
---|
162 | </para>
|
---|
163 |
|
---|
164 | <para>
|
---|
165 | Some modifications are then made to the newly created share:
|
---|
166 | </para>
|
---|
167 |
|
---|
168 | <itemizedlist>
|
---|
169 | <listitem><para>
|
---|
170 | The share name is changed from homes to the located username.
|
---|
171 | </para></listitem>
|
---|
172 |
|
---|
173 | <listitem><para>
|
---|
174 | If no path was given, the path is set to the user's home directory.
|
---|
175 | </para></listitem>
|
---|
176 | </itemizedlist>
|
---|
177 |
|
---|
178 | <para>
|
---|
179 | If you decide to use a <emphasis>path =</emphasis> line in your [homes] section, it may be useful
|
---|
180 | to use the %S macro. For example:
|
---|
181 | <programlisting>
|
---|
182 | <userinput moreinfo="none">path = /data/pchome/%S</userinput>
|
---|
183 | </programlisting>
|
---|
184 | is useful if you have different home directories for your PCs than for UNIX access.
|
---|
185 | </para>
|
---|
186 |
|
---|
187 | <para>
|
---|
188 | This is a fast and simple way to give a large number of clients access to their home directories with a minimum
|
---|
189 | of fuss.
|
---|
190 | </para>
|
---|
191 |
|
---|
192 | <para>
|
---|
193 | A similar process occurs if the requested section name is <quote>homes</quote>, except that the share
|
---|
194 | name is not changed to that of the requesting user. This method of using the [homes] section works well if
|
---|
195 | different users share a client PC.
|
---|
196 | </para>
|
---|
197 |
|
---|
198 | <para>
|
---|
199 | The [homes] section can specify all the parameters a normal service section can specify, though some make more sense
|
---|
200 | than others. The following is a typical and suitable [homes] section:
|
---|
201 | <programlisting>
|
---|
202 | <smbconfsection name="[homes]"/>
|
---|
203 | <smbconfoption name="read only">no</smbconfoption>
|
---|
204 | </programlisting>
|
---|
205 | </para>
|
---|
206 |
|
---|
207 | <para>
|
---|
208 | An important point is that if guest access is specified in the [homes] section, all home directories will be
|
---|
209 | visible to all clients <emphasis>without a password</emphasis>. In the very unlikely event that this is actually
|
---|
210 | desirable, it is wise to also specify <emphasis>read only access</emphasis>.
|
---|
211 | </para>
|
---|
212 |
|
---|
213 | <para>
|
---|
214 | The <emphasis>browseable</emphasis> flag for auto home directories will be inherited from the global browseable
|
---|
215 | flag, not the [homes] browseable flag. This is useful as it means setting <emphasis>browseable = no</emphasis> in
|
---|
216 | the [homes] section will hide the [homes] share but make any auto home directories visible.
|
---|
217 | </para>
|
---|
218 | </refsect2>
|
---|
219 |
|
---|
220 | <refsect2 id="PRINTERSSECT">
|
---|
221 | <title>The [printers] section</title>
|
---|
222 |
|
---|
223 | <para>
|
---|
224 | This section works like [homes], but for printers.
|
---|
225 | </para>
|
---|
226 |
|
---|
227 | <para>
|
---|
228 | If a [printers] section occurs in the configuration file, users are able to connect to any printer
|
---|
229 | specified in the local host's printcap file.
|
---|
230 | </para>
|
---|
231 |
|
---|
232 | <para>
|
---|
233 | When a connection request is made, the existing sections are scanned. If a match is found, it is used.
|
---|
234 | If no match is found, but a [homes] section exists, it is used as described above. Otherwise, the requested
|
---|
235 | section name is treated as a printer name and the appropriate printcap file is scanned to see if the requested
|
---|
236 | section name is a valid printer share name. If a match is found, a new printer share is created by cloning the
|
---|
237 | [printers] section.
|
---|
238 | </para>
|
---|
239 |
|
---|
240 | <para>
|
---|
241 | A few modifications are then made to the newly created share:
|
---|
242 | </para>
|
---|
243 |
|
---|
244 | <itemizedlist>
|
---|
245 | <listitem><para>The share name is set to the located printer name</para></listitem>
|
---|
246 |
|
---|
247 | <listitem><para>If no printer name was given, the printer name is set to the located printer name</para></listitem>
|
---|
248 |
|
---|
249 | <listitem><para>If the share does not permit guest access and no username was given, the username is set
|
---|
250 | to the located printer name.</para></listitem>
|
---|
251 | </itemizedlist>
|
---|
252 |
|
---|
253 | <para>
|
---|
254 | The [printers] service MUST be printable - if you specify otherwise, the server will refuse
|
---|
255 | to load the configuration file.
|
---|
256 | </para>
|
---|
257 |
|
---|
258 | <para>
|
---|
259 | Typically the path specified is that of a world-writeable spool directory with the sticky bit set on
|
---|
260 | it. A typical [printers] entry looks like this:
|
---|
261 | <programlisting>
|
---|
262 | <smbconfsection name="[printers]"/>
|
---|
263 | <smbconfoption name="path">/usr/spool/public</smbconfoption>
|
---|
264 | <smbconfoption name="guest ok">yes</smbconfoption>
|
---|
265 | <smbconfoption name="printable">yes</smbconfoption>
|
---|
266 | </programlisting>
|
---|
267 | </para>
|
---|
268 |
|
---|
269 | <para>
|
---|
270 | All aliases given for a printer in the printcap file are legitimate printer names as far as the server is concerned.
|
---|
271 | If your printing subsystem doesn't work like that, you will have to set up a pseudo-printcap. This is a file
|
---|
272 | consisting of one or more lines like this:
|
---|
273 | <programlisting>
|
---|
274 | alias|alias|alias|alias...
|
---|
275 | </programlisting>
|
---|
276 | </para>
|
---|
277 |
|
---|
278 | <para>
|
---|
279 | Each alias should be an acceptable printer name for your printing subsystem. In the [global] section,
|
---|
280 | specify the new file as your printcap. The server will only recognize names found in your pseudo-printcap,
|
---|
281 | which of course can contain whatever aliases you like. The same technique could be used simply to limit access
|
---|
282 | to a subset of your local printers.
|
---|
283 | </para>
|
---|
284 |
|
---|
285 | <para>
|
---|
286 | An alias, by the way, is defined as any component of the first entry of a printcap record. Records are separated by newlines,
|
---|
287 | components (if there are more than one) are separated by vertical bar symbols (<literal>|</literal>).
|
---|
288 | </para>
|
---|
289 |
|
---|
290 | <note><para>
|
---|
291 | On SYSV systems which use lpstat to determine what printers are defined on the system you may be able to use
|
---|
292 | <literal>printcap name = lpstat</literal> to automatically obtain a list of printers. See the
|
---|
293 | <literal>printcap name</literal> option for more details.
|
---|
294 | </para></note>
|
---|
295 | </refsect2>
|
---|
296 | </refsect1>
|
---|
297 |
|
---|
298 | <refsect1>
|
---|
299 | <title>USERSHARES</title>
|
---|
300 |
|
---|
301 | <para>Starting with Samba version 3.0.23 the capability for non-root users to add, modify, and delete
|
---|
302 | their own share definitions has been added. This capability is called <emphasis>usershares</emphasis> and
|
---|
303 | is controlled by a set of parameters in the [global] section of the smb.conf.
|
---|
304 | The relevant parameters are :
|
---|
305 | </para>
|
---|
306 |
|
---|
307 | <variablelist>
|
---|
308 | <varlistentry>
|
---|
309 | <term>usershare allow guests</term>
|
---|
310 | <listitem><para>Controls if usershares can permit guest access.</para></listitem>
|
---|
311 | </varlistentry>
|
---|
312 |
|
---|
313 | <varlistentry>
|
---|
314 | <term>usershare max shares</term>
|
---|
315 | <listitem><para>Maximum number of user defined shares allowed.</para></listitem>
|
---|
316 | </varlistentry>
|
---|
317 |
|
---|
318 | <varlistentry>
|
---|
319 | <term>usershare owner only</term>
|
---|
320 | <listitem><para>If set only directories owned by the sharing user can be shared.</para></listitem>
|
---|
321 | </varlistentry>
|
---|
322 |
|
---|
323 | <varlistentry>
|
---|
324 | <term>usershare path</term>
|
---|
325 | <listitem><para>Points to the directory containing the user defined share definitions.
|
---|
326 | The filesystem permissions on this directory control who can create user defined shares.</para></listitem>
|
---|
327 | </varlistentry>
|
---|
328 |
|
---|
329 | <varlistentry>
|
---|
330 | <term>usershare prefix allow list</term>
|
---|
331 | <listitem><para>Comma-separated list of absolute pathnames restricting what directories
|
---|
332 | can be shared. Only directories below the pathnames in this list are permitted.</para></listitem>
|
---|
333 | </varlistentry>
|
---|
334 |
|
---|
335 | <varlistentry>
|
---|
336 | <term>usershare prefix deny list</term>
|
---|
337 | <listitem><para>Comma-separated list of absolute pathnames restricting what directories
|
---|
338 | can be shared. Directories below the pathnames in this list are prohibited.</para></listitem>
|
---|
339 | </varlistentry>
|
---|
340 |
|
---|
341 | <varlistentry>
|
---|
342 | <term>usershare template share</term>
|
---|
343 | <listitem><para>Names a pre-existing share used as a template for creating new usershares.
|
---|
344 | All other share parameters not specified in the user defined share definition
|
---|
345 | are copied from this named share.</para></listitem>
|
---|
346 | </varlistentry>
|
---|
347 | </variablelist>
|
---|
348 |
|
---|
349 | <para>To allow members of the UNIX group <literal>foo</literal> to create user defined
|
---|
350 | shares, create the directory to contain the share definitions as follows:
|
---|
351 | </para>
|
---|
352 | <para>Become root:</para>
|
---|
353 | <programlisting>
|
---|
354 | mkdir /usr/local/samba/lib/usershares
|
---|
355 | chgrp foo /usr/local/samba/lib/usershares
|
---|
356 | chmod 1770 /usr/local/samba/lib/usershares
|
---|
357 | </programlisting>
|
---|
358 | <para>Then add the parameters
|
---|
359 |
|
---|
360 | <programlisting>
|
---|
361 | <smbconfoption name="usershare path">/usr/local/samba/lib/usershares</smbconfoption>
|
---|
362 | <smbconfoption name="usershare max shares">10</smbconfoption> # (or the desired number of shares)
|
---|
363 | </programlisting>
|
---|
364 |
|
---|
365 | to the global
|
---|
366 | section of your <filename>smb.conf</filename>. Members of the group foo may then manipulate the user defined shares
|
---|
367 | using the following commands.</para>
|
---|
368 |
|
---|
369 | <variablelist>
|
---|
370 | <varlistentry>
|
---|
371 | <term>net usershare add sharename path [comment] [acl] [guest_ok=[y|n]]</term>
|
---|
372 | <listitem><para>To create or modify (overwrite) a user defined share.</para></listitem>
|
---|
373 | </varlistentry>
|
---|
374 |
|
---|
375 | <varlistentry>
|
---|
376 | <term>net usershare delete sharename</term>
|
---|
377 | <listitem><para>To delete a user defined share.</para></listitem>
|
---|
378 | </varlistentry>
|
---|
379 |
|
---|
380 | <varlistentry>
|
---|
381 | <term>net usershare list wildcard-sharename</term>
|
---|
382 | <listitem><para>To list user defined shares.</para></listitem>
|
---|
383 | </varlistentry>
|
---|
384 |
|
---|
385 | <varlistentry>
|
---|
386 | <term>net usershare info wildcard-sharename</term>
|
---|
387 | <listitem><para>To print information about user defined shares.</para></listitem>
|
---|
388 | </varlistentry>
|
---|
389 | </variablelist>
|
---|
390 | </refsect1>
|
---|
391 |
|
---|
392 | <refsect1>
|
---|
393 | <title>PARAMETERS</title>
|
---|
394 |
|
---|
395 | <para>Parameters define the specific attributes of sections.</para>
|
---|
396 |
|
---|
397 | <para>
|
---|
398 | Some parameters are specific to the [global] section (e.g., <emphasis>security</emphasis>). Some parameters
|
---|
399 | are usable in all sections (e.g., <emphasis>create mask</emphasis>). All others are permissible only in normal
|
---|
400 | sections. For the purposes of the following descriptions the [homes] and [printers] sections will be
|
---|
401 | considered normal. The letter <emphasis>G</emphasis> in parentheses indicates that a parameter is specific to
|
---|
402 | the [global] section. The letter <emphasis>S</emphasis> indicates that a parameter can be specified in a
|
---|
403 | service specific section. All <emphasis>S</emphasis> parameters can also be specified in the [global] section
|
---|
404 | - in which case they will define the default behavior for all services.
|
---|
405 | </para>
|
---|
406 |
|
---|
407 | <para>
|
---|
408 | Parameters are arranged here in alphabetical order - this may not create best bedfellows, but at least you can
|
---|
409 | find them! Where there are synonyms, the preferred synonym is described, others refer to the preferred
|
---|
410 | synonym.
|
---|
411 | </para>
|
---|
412 | </refsect1>
|
---|
413 |
|
---|
414 | <refsect1>
|
---|
415 | <title>VARIABLE SUBSTITUTIONS</title>
|
---|
416 |
|
---|
417 | <para>
|
---|
418 | Many of the strings that are settable in the config file can take substitutions. For example the option
|
---|
419 | <quote>path = /tmp/%u</quote> is interpreted as <quote>path = /tmp/john</quote> if the user connected with the
|
---|
420 | username john.
|
---|
421 | </para>
|
---|
422 |
|
---|
423 | <para>
|
---|
424 | These substitutions are mostly noted in the descriptions below, but there are some general substitutions
|
---|
425 | which apply whenever they might be relevant. These are:
|
---|
426 | </para>
|
---|
427 |
|
---|
428 | <variablelist>
|
---|
429 | <varlistentry>
|
---|
430 | <term>%U</term>
|
---|
431 | <listitem><para>session username (the username that the client wanted, not
|
---|
432 | necessarily the same as the one they got).</para></listitem>
|
---|
433 | </varlistentry>
|
---|
434 |
|
---|
435 | <varlistentry>
|
---|
436 | <term>%G</term>
|
---|
437 | <listitem><para>primary group name of %U.</para></listitem>
|
---|
438 | </varlistentry>
|
---|
439 |
|
---|
440 | <varlistentry>
|
---|
441 | <term>%h</term>
|
---|
442 | <listitem><para>the Internet hostname that Samba is running on.</para></listitem>
|
---|
443 | </varlistentry>
|
---|
444 |
|
---|
445 | <varlistentry>
|
---|
446 | <term>%m</term>
|
---|
447 | <listitem><para>the NetBIOS name of the client machine (very useful).</para>
|
---|
448 |
|
---|
449 | <para>This parameter is not available when Samba listens on port 445, as clients no longer
|
---|
450 | send this information. If you use this macro in an include statement on a domain that has
|
---|
451 | a Samba domain controller be sure to set in the [global] section <parameter>smb ports =
|
---|
452 | 139</parameter>. This will cause Samba to not listen on port 445 and will permit include
|
---|
453 | functionality to function as it did with Samba 2.x.
|
---|
454 | </para></listitem>
|
---|
455 |
|
---|
456 | </varlistentry>
|
---|
457 |
|
---|
458 | <varlistentry>
|
---|
459 | <term>%L</term>
|
---|
460 | <listitem><para>the NetBIOS name of the server. This allows you to change your config based on what
|
---|
461 | the client calls you. Your server can have a <quote>dual personality</quote>.
|
---|
462 | </para></listitem>
|
---|
463 | </varlistentry>
|
---|
464 |
|
---|
465 | <varlistentry>
|
---|
466 | <term>%M</term>
|
---|
467 | <listitem><para>the Internet name of the client machine.
|
---|
468 | </para></listitem>
|
---|
469 | </varlistentry>
|
---|
470 |
|
---|
471 | <varlistentry>
|
---|
472 | <term>%R</term>
|
---|
473 | <listitem><para>the selected protocol level after protocol negotiation. It can be one of
|
---|
474 | CORE, COREPLUS, LANMAN1, LANMAN2, NT1,
|
---|
475 | SMB2_02, SMB2_10, SMB2_22, SMB2_24,
|
---|
476 | SMB3_00, SMB3_02, SMB3_10, SMB3_11
|
---|
477 | or SMB2_FF.</para></listitem>
|
---|
478 | </varlistentry>
|
---|
479 |
|
---|
480 | <varlistentry>
|
---|
481 | <term>%d</term>
|
---|
482 | <listitem><para>the process id of the current server
|
---|
483 | process.</para></listitem>
|
---|
484 | </varlistentry>
|
---|
485 |
|
---|
486 | <varlistentry>
|
---|
487 | <term>%a</term>
|
---|
488 | <listitem><para>
|
---|
489 | The architecture of the remote
|
---|
490 | machine. It currently recognizes Samba (<constant>Samba</constant>),
|
---|
491 | the Linux CIFS file system (<constant>CIFSFS</constant>), OS/2, (<constant>OS2</constant>),
|
---|
492 | Mac OS X (<constant>OSX</constant>), Windows for Workgroups (<constant>WfWg</constant>), Windows 9x/ME
|
---|
493 | (<constant>Win95</constant>), Windows NT (<constant>WinNT</constant>),
|
---|
494 | Windows 2000 (<constant>Win2K</constant>),
|
---|
495 | Windows XP (<constant>WinXP</constant>),
|
---|
496 | Windows XP 64-bit(<constant>WinXP64</constant>),
|
---|
497 | Windows 2003 including
|
---|
498 | 2003R2 (<constant>Win2K3</constant>), and Windows
|
---|
499 | Vista (<constant>Vista</constant>). Anything else will be known as
|
---|
500 | <constant>UNKNOWN</constant>.</para>
|
---|
501 | </listitem>
|
---|
502 | </varlistentry>
|
---|
503 |
|
---|
504 | <varlistentry>
|
---|
505 | <term>%I</term>
|
---|
506 | <listitem><para>the IP address of the client machine.</para>
|
---|
507 | <para>Before 4.0.0 it could contain IPv4 mapped IPv6 addresses,
|
---|
508 | now it only contains IPv4 or IPv6 addresses.</para>
|
---|
509 | </listitem>
|
---|
510 | </varlistentry>
|
---|
511 |
|
---|
512 | <varlistentry>
|
---|
513 | <term>%i</term>
|
---|
514 | <listitem><para>the local IP address to which a client connected.</para>
|
---|
515 | <para>Before 4.0.0 it could contain IPv4 mapped IPv6 addresses,
|
---|
516 | now it only contains IPv4 or IPv6 addresses.</para>
|
---|
517 | </listitem>
|
---|
518 | </varlistentry>
|
---|
519 |
|
---|
520 | <varlistentry>
|
---|
521 | <term>%T</term>
|
---|
522 | <listitem><para>the current date and time.</para></listitem>
|
---|
523 | </varlistentry>
|
---|
524 |
|
---|
525 | <varlistentry>
|
---|
526 | <term>%D</term>
|
---|
527 | <listitem><para>name of the domain or workgroup of the current user.</para></listitem>
|
---|
528 | </varlistentry>
|
---|
529 |
|
---|
530 | <varlistentry>
|
---|
531 | <term>%w</term>
|
---|
532 | <listitem><para>the winbind separator.</para></listitem>
|
---|
533 | </varlistentry>
|
---|
534 |
|
---|
535 | <varlistentry>
|
---|
536 | <term>%$(<replaceable>envvar</replaceable>)</term>
|
---|
537 | <listitem><para>the value of the environment variable
|
---|
538 | <replaceable>envar</replaceable>.</para></listitem>
|
---|
539 | </varlistentry>
|
---|
540 | </variablelist>
|
---|
541 |
|
---|
542 | <para>
|
---|
543 | The following substitutes apply only to some configuration options (only those that are
|
---|
544 | used when a connection has been established):
|
---|
545 | </para>
|
---|
546 |
|
---|
547 | <variablelist>
|
---|
548 | <varlistentry>
|
---|
549 | <term>%S</term>
|
---|
550 | <listitem><para>the name of the current service, if any.</para>
|
---|
551 | </listitem>
|
---|
552 | </varlistentry>
|
---|
553 |
|
---|
554 | <varlistentry>
|
---|
555 | <term>%P</term>
|
---|
556 | <listitem><para>the root directory of the current service, if any.</para></listitem>
|
---|
557 | </varlistentry>
|
---|
558 |
|
---|
559 | <varlistentry>
|
---|
560 | <term>%u</term>
|
---|
561 | <listitem><para>username of the current service, if any.</para>
|
---|
562 | </listitem>
|
---|
563 | </varlistentry>
|
---|
564 |
|
---|
565 | <varlistentry>
|
---|
566 | <term>%g</term>
|
---|
567 | <listitem><para>primary group name of %u.</para></listitem>
|
---|
568 | </varlistentry>
|
---|
569 |
|
---|
570 | <varlistentry>
|
---|
571 | <term>%H</term>
|
---|
572 | <listitem><para>the home directory of the user given by %u.</para></listitem>
|
---|
573 | </varlistentry>
|
---|
574 |
|
---|
575 | <varlistentry>
|
---|
576 | <term>%N</term>
|
---|
577 | <listitem><para>
|
---|
578 | the name of your NIS home directory server. This is obtained from your NIS auto.map entry.
|
---|
579 | If you have not compiled Samba with the <emphasis>--with-automount</emphasis> option, this
|
---|
580 | value will be the same as %L.</para></listitem>
|
---|
581 | </varlistentry>
|
---|
582 |
|
---|
583 | <varlistentry>
|
---|
584 | <term>%p</term>
|
---|
585 | <listitem><para>
|
---|
586 | the path of the service's home directory, obtained from your NIS auto.map entry. The NIS
|
---|
587 | auto.map entry is split up as <literal>%N:%p</literal>.</para></listitem>
|
---|
588 | </varlistentry>
|
---|
589 | </variablelist>
|
---|
590 |
|
---|
591 | <para>
|
---|
592 | There are some quite creative things that can be done with these substitutions and other
|
---|
593 | <filename moreinfo="none">smb.conf</filename> options.
|
---|
594 | </para>
|
---|
595 | </refsect1>
|
---|
596 |
|
---|
597 | <refsect1 id="NAMEMANGLINGSECT">
|
---|
598 | <title>NAME MANGLING</title>
|
---|
599 |
|
---|
600 | <para>
|
---|
601 | Samba supports <literal>name mangling</literal> so that DOS and Windows clients can use files that don't
|
---|
602 | conform to the 8.3 format. It can also be set to adjust the case of 8.3 format filenames.
|
---|
603 | </para>
|
---|
604 |
|
---|
605 | <para>
|
---|
606 | There are several options that control the way mangling is performed, and they are grouped here rather
|
---|
607 | than listed separately. For the defaults look at the output of the testparm program.
|
---|
608 | </para>
|
---|
609 |
|
---|
610 | <para>
|
---|
611 | These options can be set separately for each service.
|
---|
612 | </para>
|
---|
613 |
|
---|
614 | <para>
|
---|
615 | The options are:
|
---|
616 | </para>
|
---|
617 |
|
---|
618 | <variablelist>
|
---|
619 |
|
---|
620 | <varlistentry>
|
---|
621 | <term>case sensitive = yes/no/auto</term>
|
---|
622 | <listitem><para>
|
---|
623 | controls whether filenames are case sensitive. If they aren't, Samba must do a filename search and match on
|
---|
624 | passed names. The default setting of auto allows clients that support case sensitive filenames (Linux CIFSVFS
|
---|
625 | and smbclient 3.0.5 and above currently) to tell the Samba server on a per-packet basis that they wish to
|
---|
626 | access the file system in a case-sensitive manner (to support UNIX case sensitive semantics). No Windows or
|
---|
627 | DOS system supports case-sensitive filename so setting this option to auto is that same as setting it to no
|
---|
628 | for them. Default <emphasis>auto</emphasis>.
|
---|
629 | </para></listitem>
|
---|
630 | </varlistentry>
|
---|
631 |
|
---|
632 | <varlistentry>
|
---|
633 | <term>default case = upper/lower</term>
|
---|
634 | <listitem><para>
|
---|
635 | controls what the default case is for new filenames (ie. files that don't currently exist in the filesystem).
|
---|
636 | Default <emphasis>lower</emphasis>. IMPORTANT NOTE: As part of the optimizations for directories containing
|
---|
637 | large numbers of files, the following special case applies. If the options
|
---|
638 | <smbconfoption name="case sensitive">yes</smbconfoption>, <smbconfoption name="preserve case">No</smbconfoption>, and
|
---|
639 | <smbconfoption name="short preserve case">No</smbconfoption> are set, then the case of <emphasis>all</emphasis>
|
---|
640 | incoming client filenames, not just new filenames, will be modified. See additional notes below.
|
---|
641 | </para></listitem>
|
---|
642 | </varlistentry>
|
---|
643 |
|
---|
644 | <varlistentry>
|
---|
645 | <term>preserve case = yes/no</term>
|
---|
646 | <listitem><para>
|
---|
647 | controls whether new files (ie. files that don't currently exist in the filesystem) are created with the case
|
---|
648 | that the client passes, or if they are forced to be the <literal>default</literal> case. Default
|
---|
649 | <emphasis>yes</emphasis>.
|
---|
650 | </para></listitem>
|
---|
651 | </varlistentry>
|
---|
652 |
|
---|
653 | <varlistentry>
|
---|
654 | <term>short preserve case = yes/no</term>
|
---|
655 | <listitem><para>
|
---|
656 | controls if new files (ie. files that don't currently exist in the filesystem) which conform to 8.3 syntax,
|
---|
657 | that is all in upper case and of suitable length, are created upper case, or if they are forced to be the
|
---|
658 | <literal>default</literal> case. This option can be used with <literal>preserve case = yes</literal> to permit
|
---|
659 | long filenames to retain their case, while short names are lowercased. Default <emphasis>yes</emphasis>.
|
---|
660 | </para></listitem>
|
---|
661 | </varlistentry>
|
---|
662 | </variablelist>
|
---|
663 |
|
---|
664 | <para>
|
---|
665 | By default, Samba 3.0 has the same semantics as a Windows NT server, in that it is case insensitive
|
---|
666 | but case preserving. As a special case for directories with large numbers of files, if the case
|
---|
667 | options are set as follows, "case sensitive = yes", "case preserve = no", "short preserve case = no"
|
---|
668 | then the "default case" option will be applied and will modify all filenames sent from the client
|
---|
669 | when accessing this share.
|
---|
670 | </para>
|
---|
671 |
|
---|
672 | </refsect1>
|
---|
673 |
|
---|
674 | <refsect1>
|
---|
675 | <title>REGISTRY-BASED CONFIGURATION</title>
|
---|
676 |
|
---|
677 | <para>
|
---|
678 | Starting with Samba version 3.2.0, the capability to
|
---|
679 | store Samba configuration in the registry is available.
|
---|
680 | The configuration is stored in the registry key
|
---|
681 | <emphasis><literal>HKLM\Software\Samba\smbconf</literal></emphasis>.
|
---|
682 | There are two levels of registry configuration:
|
---|
683 | </para>
|
---|
684 |
|
---|
685 | <orderedlist continuation="restarts" inheritnum="ignore" numeration="arabic">
|
---|
686 | <listitem><para>Share definitions stored in registry are used.
|
---|
687 | This is triggered by setting the global
|
---|
688 | parameter <parameter>registry shares</parameter>
|
---|
689 | to <quote>yes</quote> in <emphasis>smb.conf</emphasis>.
|
---|
690 | </para>
|
---|
691 |
|
---|
692 | <para>The registry shares are loaded not at startup but
|
---|
693 | on demand at runtime by <emphasis>smbd</emphasis>.
|
---|
694 | Shares defined in <emphasis>smb.conf</emphasis> take
|
---|
695 | priority over shares of the same name defined in
|
---|
696 | registry.</para></listitem>
|
---|
697 |
|
---|
698 | <listitem>
|
---|
699 | <para>Global <emphasis>smb.conf</emphasis>
|
---|
700 | options stored in registry are used. This can be activated
|
---|
701 | in two different ways:</para>
|
---|
702 |
|
---|
703 | <para>Firstly, a registry only configuration is triggered
|
---|
704 | by setting
|
---|
705 | <smbconfoption name="config backend">registry</smbconfoption>
|
---|
706 | in the [global] section of <emphasis>smb.conf</emphasis>.
|
---|
707 | This resets everything that has been read from config files
|
---|
708 | to this point and reads the content of the global configuration
|
---|
709 | section from the registry.
|
---|
710 | This is the recommended method of using registry based
|
---|
711 | configuration.</para>
|
---|
712 |
|
---|
713 | <para>Secondly, a mixed configuration can be activated
|
---|
714 | by a special new meaning of the parameter
|
---|
715 | <smbconfoption name="include">registry</smbconfoption>
|
---|
716 | in the [global] section of <emphasis>smb.conf</emphasis>.
|
---|
717 | This reads the global options from registry with the same
|
---|
718 | priorities as for an include of a text file.
|
---|
719 | This may be especially useful in cases where an initial
|
---|
720 | configuration is needed to access the registry.</para>
|
---|
721 |
|
---|
722 | <para>Activation of global registry options automatically
|
---|
723 | activates registry shares. So in the registry only case,
|
---|
724 | shares are loaded on demand only.</para>
|
---|
725 | </listitem>
|
---|
726 | </orderedlist>
|
---|
727 |
|
---|
728 | <para>
|
---|
729 | Note: To make registry-based configurations foolproof
|
---|
730 | at least to a certain extent, the use
|
---|
731 | of <parameter>lock directory</parameter> and
|
---|
732 | <parameter>config backend</parameter>
|
---|
733 | inside the registry configuration has been disabled:
|
---|
734 | Especially by changing the
|
---|
735 | <parameter>lock directory</parameter> inside the registry
|
---|
736 | configuration, one would create a broken setup where the daemons
|
---|
737 | do not see the configuration they loaded once it is active.
|
---|
738 | </para>
|
---|
739 |
|
---|
740 | <para>
|
---|
741 | The registry configuration can be accessed with
|
---|
742 | tools like <emphasis>regedit</emphasis> or <emphasis>net (rpc)
|
---|
743 | registry</emphasis> in the key
|
---|
744 | <emphasis><literal>HKLM\Software\Samba\smbconf</literal></emphasis>.
|
---|
745 |
|
---|
746 | More conveniently, the <emphasis>conf</emphasis> subcommand of the
|
---|
747 | <citerefentry><refentrytitle>net</refentrytitle>
|
---|
748 | <manvolnum>8</manvolnum></citerefentry> utility
|
---|
749 | offers a dedicated interface to read and write the
|
---|
750 | registry based configuration locally, i.e. directly
|
---|
751 | accessing the database file, circumventing the
|
---|
752 | server.
|
---|
753 | </para>
|
---|
754 |
|
---|
755 | </refsect1>
|
---|
756 |
|
---|
757 | <refsect1>
|
---|
758 | <title>EXPLANATION OF EACH PARAMETER</title>
|
---|
759 |
|
---|
760 | <samba:parameterlist>
|
---|
761 | <!-- The URI below is resolved to local generated version of parameters.all.xml //-->
|
---|
762 | <!-- WAF build places it in bin/default/docs-xml/smbdotconf/parameters.all.xml //-->
|
---|
763 | <!-- and we redirect there via use of XML_CATALOG_FILES, see docs-xml/build/catalog.xml.in //-->
|
---|
764 | <xi:include href="http://www.samba.org/samba/smbdotconf/parameters.all.xml" parse="xml"/>
|
---|
765 | </samba:parameterlist>
|
---|
766 |
|
---|
767 | </refsect1>
|
---|
768 |
|
---|
769 | <refsect1>
|
---|
770 | <title>WARNINGS</title>
|
---|
771 |
|
---|
772 | <para>
|
---|
773 | Although the configuration file permits service names to contain spaces, your client software may not.
|
---|
774 | Spaces will be ignored in comparisons anyway, so it shouldn't be a problem - but be aware of the possibility.
|
---|
775 | </para>
|
---|
776 |
|
---|
777 | <para>
|
---|
778 | On a similar note, many clients - especially DOS clients - limit service names to eight characters.
|
---|
779 | <citerefentry><refentrytitle>smbd</refentrytitle> <manvolnum>8</manvolnum></citerefentry> has no such
|
---|
780 | limitation, but attempts to connect from such clients will fail if they truncate the service names. For this
|
---|
781 | reason you should probably keep your service names down to eight characters in length.
|
---|
782 | </para>
|
---|
783 |
|
---|
784 | <para>
|
---|
785 | Use of the <literal>[homes]</literal> and <literal>[printers]</literal> special sections make life
|
---|
786 | for an administrator easy, but the various combinations of default attributes can be tricky. Take extreme
|
---|
787 | care when designing these sections. In particular, ensure that the permissions on spool directories are
|
---|
788 | correct.
|
---|
789 | </para>
|
---|
790 |
|
---|
791 | </refsect1>
|
---|
792 |
|
---|
793 | <refsect1>
|
---|
794 | <title>VERSION</title>
|
---|
795 |
|
---|
796 | <para>This man page is correct for version 4 of the Samba suite.</para>
|
---|
797 | </refsect1>
|
---|
798 |
|
---|
799 | <refsect1>
|
---|
800 | <title>SEE ALSO</title>
|
---|
801 | <para>
|
---|
802 | <citerefentry><refentrytitle>samba</refentrytitle>
|
---|
803 | <manvolnum>7</manvolnum></citerefentry>, <citerefentry><refentrytitle>smbpasswd</refentrytitle>
|
---|
804 | <manvolnum>8</manvolnum></citerefentry>, <citerefentry><refentrytitle>smbd</refentrytitle>
|
---|
805 | <manvolnum>8</manvolnum></citerefentry>, <citerefentry><refentrytitle>nmbd</refentrytitle>
|
---|
806 | <manvolnum>8</manvolnum></citerefentry>, <citerefentry><refentrytitle>winbindd</refentrytitle>
|
---|
807 | <manvolnum>8</manvolnum></citerefentry>, <citerefentry><refentrytitle>samba</refentrytitle>
|
---|
808 | <manvolnum>8</manvolnum></citerefentry>, <citerefentry><refentrytitle>samba-tool</refentrytitle>
|
---|
809 | <manvolnum>8</manvolnum></citerefentry>, <citerefentry><refentrytitle>smbclient</refentrytitle>
|
---|
810 | <manvolnum>1</manvolnum></citerefentry>, <citerefentry><refentrytitle>nmblookup</refentrytitle>
|
---|
811 | <manvolnum>1</manvolnum></citerefentry>, <citerefentry><refentrytitle>testparm</refentrytitle>
|
---|
812 | <manvolnum>1</manvolnum></citerefentry>.</para>
|
---|
813 | </refsect1>
|
---|
814 |
|
---|
815 | <refsect1>
|
---|
816 | <title>AUTHOR</title>
|
---|
817 |
|
---|
818 | <para>
|
---|
819 | The original Samba software and related utilities were created by Andrew Tridgell. Samba is now developed
|
---|
820 | by the Samba Team as an Open Source project similar to the way the Linux kernel is developed.
|
---|
821 | </para>
|
---|
822 |
|
---|
823 | <para>
|
---|
824 | The original Samba man pages were written by Karl Auer. The man page sources were converted to YODL format (another
|
---|
825 | excellent piece of Open Source software, available at <ulink noescape="1" url="ftp://ftp.icce.rug.nl/pub/unix/">
|
---|
826 | ftp://ftp.icce.rug.nl/pub/unix/</ulink>) and updated for the Samba 2.0 release by Jeremy Allison. The conversion
|
---|
827 | 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
|
---|
828 | Alexander Bokovoy.
|
---|
829 | </para>
|
---|
830 | </refsect1>
|
---|
831 |
|
---|
832 | </refentry>
|
---|