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