2017-12-12 11:08:06 +03:00
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE refentry PUBLIC "-//Samba-Team//DTD DocBook V4.2-Based Variant V1.0//EN" "http://www.samba.org/samba/DTD/samba-doc">
2005-07-05 04:19:04 +04:00
<refentry id= "smb.conf.5" xmlns:xi= "http://www.w3.org/2003/XInclude"
xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
2021-10-06 15:01:42 +03:00
2005-05-21 04:23:25 +04:00
<refmeta >
<refentrytitle > smb.conf</refentrytitle>
<manvolnum > 5</manvolnum>
2008-04-07 00:26:45 +04:00
<refmiscinfo class= "source" > Samba</refmiscinfo>
<refmiscinfo class= "manual" > File Formats and Conventions</refmiscinfo>
2017-12-12 11:08:06 +03:00
<refmiscinfo class= "version" > &doc.version; </refmiscinfo>
2005-05-21 04:23:25 +04:00
</refmeta>
<refnamediv >
<refname > smb.conf</refname>
<refpurpose > The configuration file for the Samba suite</refpurpose>
</refnamediv>
<refsect1 >
<title > SYNOPSIS</title>
2005-06-16 08:54:09 +04:00
<para >
The <filename moreinfo= "none" > smb.conf</filename> file is a configuration file for the Samba suite. <filename
moreinfo="none">smb.conf</filename> contains runtime configuration information for the Samba programs. The
complete description of the file format and possible parameters held within are here for reference purposes.
2013-07-24 12:12:19 +04:00
</para>
2005-06-16 08:54:09 +04:00
</refsect1>
2005-05-21 04:23:25 +04:00
2020-10-17 10:58:12 +03:00
<refsect1 >
<title > HOW CONFIGURATION CHANGES ARE APPLIED</title>
<para >
The Samba suite includes a number of different programs. Some of them operate in a client mode, others are
server daemons that provide various services to its clients. The <filename moreinfo= "none" > smb.conf
</filename> file is processed in the following way:
</para>
<itemizedlist >
<listitem > <para >
The Samba suite's client applications read their configuration only once. Any changes made after start aren't
reflected in the context of already running client code.
</para> </listitem>
<listitem > <para >
The Samba suite's server daemons reload their configuration when requested. However, already active connections
do not change their configuration. More detailed information can be found in
<citerefentry > <refentrytitle > smbd</refentrytitle> <manvolnum > 8</manvolnum> </citerefentry> and <citerefentry >
<refentrytitle > winbindd</refentrytitle> <manvolnum > 8</manvolnum> </citerefentry> manual pages.
</para> </listitem>
</itemizedlist>
<para >
To request Samba server daemons to refresh their configuration, please use
<citerefentry > <refentrytitle > smbcontrol</refentrytitle> <manvolnum > 1</manvolnum> </citerefentry> utility.
</para>
</refsect1>
2005-05-21 04:23:25 +04:00
<refsect1 id= "FILEFORMATSECT" >
<title > FILE FORMAT</title>
2005-06-16 08:54:09 +04:00
<para >
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:
2005-08-25 20:49:40 +04:00
<programlisting >
2005-06-16 08:54:09 +04:00
<replaceable > name</replaceable> = <replaceable > value </replaceable>
2005-08-25 20:49:40 +04:00
</programlisting>
2005-06-16 08:54:09 +04:00
</para>
2005-05-21 04:23:25 +04:00
2005-06-16 08:54:09 +04:00
<para >
The file is line-based - that is, each newline-terminated line represents either a comment, a section name or
a parameter.
</para>
2005-05-21 04:23:25 +04:00
<para > Section and parameter names are not case sensitive.</para>
2005-06-16 08:54:09 +04:00
<para >
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.
</para>
2005-05-21 04:23:25 +04:00
2005-06-16 08:54:09 +04:00
<para >
2021-10-06 15:01:42 +03:00
Any line beginning with a semicolon (<quote > ;</quote> ) or a hash (<quote > #</quote> )
2005-06-16 08:54:09 +04:00
character is ignored, as are lines containing only whitespace.
</para>
2005-05-21 04:23:25 +04:00
2005-06-16 08:54:09 +04:00
<para >
2007-06-06 19:36:50 +04:00
Any line ending in a <quote > <literal > \</literal> </quote> is continued on the next line in the customary UNIX fashion.
2005-06-16 08:54:09 +04:00
</para>
<para >
The values following the equals sign in parameters are all either a string (no quotes needed) or a boolean,
2008-08-05 16:20:32 +04:00
which may be given as yes/no, 1/0 or true/false. Case is not significant in boolean values, but is preserved
2005-07-08 14:16:53 +04:00
in string values. Some items such as create masks are numeric.
2005-06-16 08:54:09 +04:00
</para>
2005-05-21 04:23:25 +04:00
</refsect1>
<refsect1 >
<title > SECTION DESCRIPTIONS</title>
2005-06-16 08:54:09 +04:00
<para >
Each section in the configuration file (except for the [global] section) describes a shared resource (known as
a <quote > share</quote> ). The section name is the name of the shared resource and the parameters within the
section define the shares attributes.
</para>
<para >
There are three special sections, [global], [homes] and [printers], which are described under
2007-04-16 11:47:27 +04:00
<emphasis > special sections</emphasis> . The following notes apply to ordinary section descriptions.
2005-06-16 08:54:09 +04:00
</para>
<para >
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.
</para>
2021-10-06 15:01:42 +03:00
2005-06-16 08:54:09 +04:00
<para >
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).
</para>
2021-10-06 15:01:42 +03:00
2005-06-16 08:54:09 +04:00
<para >
Sections may be designated <emphasis > guest</emphasis> services, in which case no password is required to
access them. A specified UNIX <emphasis > guest account</emphasis> is used to define access privileges in this
case.
</para>
<para >
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 <literal > user =</literal> option in the share definition. For modern clients
such as Windows 95/98/ME/NT/2000, this should not be necessary.
2021-10-06 15:01:42 +03:00
</para>
2005-06-16 08:54:09 +04:00
<para >
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.
</para>
2021-10-06 15:01:42 +03:00
2005-06-16 08:54:09 +04:00
<para >
The following sample section defines a file space share. The user has write access to the path <filename
moreinfo="none">/home/bar</filename> . The share is accessed via the share name <literal > foo</literal> :
2005-10-17 21:49:56 +04:00
<programlisting >
2005-05-21 04:23:25 +04:00
<smbconfsection name= "[foo]" />
<smbconfoption name= "path" > /home/bar</smbconfoption>
2005-09-12 00:26:46 +04:00
<smbconfoption name= "read only" > no</smbconfoption>
2005-10-17 21:49:56 +04:00
</programlisting>
</para>
2005-05-21 04:23:25 +04:00
2005-06-16 08:54:09 +04:00
<para >
The following sample section defines a printable share. The share is read-only, but printable. That is,
the only write access permitted is via calls to open, write to and close a spool file. The <emphasis > guest
ok</emphasis> parameter means access will be permitted as the default guest user (specified elsewhere):
2005-10-17 21:49:56 +04:00
<programlisting >
2005-05-21 04:23:25 +04:00
<smbconfsection name= "[aprinter]" />
2021-10-06 15:02:10 +03:00
<smbconfoption name= "path" > /var/tmp</smbconfoption>
2005-05-21 04:23:25 +04:00
<smbconfoption name= "read only" > yes</smbconfoption>
<smbconfoption name= "printable" > yes</smbconfoption>
<smbconfoption name= "guest ok" > yes</smbconfoption>
2005-10-17 21:49:56 +04:00
</programlisting>
</para>
2005-06-16 08:54:09 +04:00
2005-05-21 04:23:25 +04:00
</refsect1>
<refsect1 >
<title > SPECIAL SECTIONS</title>
2021-10-06 15:01:42 +03:00
2005-05-21 04:23:25 +04:00
<refsect2 >
<title > The [global] section</title>
2021-10-06 15:01:42 +03:00
2005-06-16 08:54:09 +04:00
<para >
Parameters in this section apply to the server as a whole, or are defaults for sections that do not
specifically define certain items. See the notes under PARAMETERS for more information.
</para>
2005-05-21 04:23:25 +04:00
</refsect2>
2021-10-06 15:01:42 +03:00
2005-05-21 04:23:25 +04:00
<refsect2 id= "HOMESECT" >
<title > The [homes] section</title>
2021-10-06 15:01:42 +03:00
2005-06-16 08:54:09 +04:00
<para >
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.
</para>
<para >
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 username 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.
</para>
2021-10-06 15:01:42 +03:00
2005-06-16 08:54:09 +04:00
<para >
Some modifications are then made to the newly created share:
</para>
2021-10-06 15:01:42 +03:00
2005-05-21 04:23:25 +04:00
<itemizedlist >
2005-06-16 08:54:09 +04:00
<listitem > <para >
The share name is changed from homes to the located username.
</para> </listitem>
2005-05-21 04:23:25 +04:00
2005-06-16 08:54:09 +04:00
<listitem > <para >
If no path was given, the path is set to the user's home directory.
</para> </listitem>
2005-05-21 04:23:25 +04:00
</itemizedlist>
2005-06-16 08:54:09 +04:00
<para >
2021-10-06 15:01:42 +03:00
If you decide to use a <emphasis > path =</emphasis> line in your [homes] section, it may be useful
2005-06-16 08:54:09 +04:00
to use the %S macro. For example:
2005-08-25 20:49:40 +04:00
<programlisting >
2005-06-16 08:54:09 +04:00
<userinput moreinfo= "none" > path = /data/pchome/%S</userinput>
2005-08-25 20:49:40 +04:00
</programlisting>
2005-06-16 08:54:09 +04:00
is useful if you have different home directories for your PCs than for UNIX access.
</para>
<para >
2021-10-06 15:01:42 +03:00
This is a fast and simple way to give a large number of clients access to their home directories with a minimum
2005-06-16 08:54:09 +04:00
of fuss.
</para>
<para >
A similar process occurs if the requested section name is <quote > homes</quote> , 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.
</para>
2021-10-06 15:01:42 +03:00
2005-06-16 08:54:09 +04:00
<para >
2021-10-06 15:01:42 +03:00
The [homes] section can specify all the parameters a normal service section can specify, though some make more sense
2005-06-16 08:54:09 +04:00
than others. The following is a typical and suitable [homes] section:
2005-10-17 21:49:56 +04:00
<programlisting >
<smbconfsection name= "[homes]" />
<smbconfoption name= "read only" > no</smbconfoption>
</programlisting>
2005-06-16 08:54:09 +04:00
</para>
2021-10-06 15:01:42 +03:00
2005-06-16 08:54:09 +04:00
<para >
2021-10-06 15:01:42 +03:00
An important point is that if guest access is specified in the [homes] section, all home directories will be
2005-06-16 08:54:09 +04:00
visible to all clients <emphasis > without a password</emphasis> . In the very unlikely event that this is actually
desirable, it is wise to also specify <emphasis > read only access</emphasis> .
</para>
<para >
2021-10-06 15:01:42 +03:00
The <emphasis > browseable</emphasis> flag for auto home directories will be inherited from the global browseable
2005-06-16 08:54:09 +04:00
flag, not the [homes] browseable flag. This is useful as it means setting <emphasis > browseable = no</emphasis> in
the [homes] section will hide the [homes] share but make any auto home directories visible.
</para>
2005-05-21 04:23:25 +04:00
</refsect2>
<refsect2 id= "PRINTERSSECT" >
<title > The [printers] section</title>
2021-10-06 15:01:42 +03:00
2005-06-16 08:54:09 +04:00
<para >
This section works like [homes], but for printers.
</para>
<para >
2021-10-06 15:01:42 +03:00
If a [printers] section occurs in the configuration file, users are able to connect to any printer
2005-06-16 08:54:09 +04:00
specified in the local host's printcap file.
</para>
<para >
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.
</para>
<para >
A few modifications are then made to the newly created share:
</para>
2005-05-21 04:23:25 +04:00
<itemizedlist >
2005-06-16 08:54:09 +04:00
<listitem > <para > The share name is set to the located printer name</para> </listitem>
2005-05-21 04:23:25 +04:00
2005-06-16 08:54:09 +04:00
<listitem > <para > If no printer name was given, the printer name is set to the located printer name</para> </listitem>
2005-05-21 04:23:25 +04:00
2005-06-16 08:54:09 +04:00
<listitem > <para > If the share does not permit guest access and no username was given, the username is set
to the located printer name.</para> </listitem>
2005-05-21 04:23:25 +04:00
</itemizedlist>
2005-06-16 08:54:09 +04:00
<para >
2021-10-06 15:01:42 +03:00
The [printers] service MUST be printable - if you specify otherwise, the server will refuse
2005-06-16 08:54:09 +04:00
to load the configuration file.
</para>
2021-10-06 15:01:42 +03:00
2005-06-16 08:54:09 +04:00
<para >
2021-10-06 15:01:42 +03:00
Typically the path specified is that of a world-writeable spool directory with the sticky bit set on
2005-06-16 08:54:09 +04:00
it. A typical [printers] entry looks like this:
2005-10-17 21:49:56 +04:00
<programlisting >
<smbconfsection name= "[printers]" />
2021-10-06 15:02:10 +03:00
<smbconfoption name= "path" > /var/tmp</smbconfoption>
2005-10-17 21:49:56 +04:00
<smbconfoption name= "guest ok" > yes</smbconfoption>
<smbconfoption name= "printable" > yes</smbconfoption>
</programlisting>
2005-06-16 08:54:09 +04:00
</para>
2005-05-21 04:23:25 +04:00
2005-06-16 08:54:09 +04:00
<para >
2021-10-06 15:01:42 +03:00
All aliases given for a printer in the printcap file are legitimate printer names as far as the server is concerned.
2005-06-16 08:54:09 +04:00
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:
2005-08-25 20:49:40 +04:00
<programlisting >
2021-10-06 15:01:42 +03:00
alias|alias|alias|alias...
2005-08-25 20:49:40 +04:00
</programlisting>
</para>
2005-06-16 08:54:09 +04:00
<para >
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 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.
</para>
<para >
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 (<literal > |</literal> ).
</para>
2021-10-06 15:01:42 +03:00
2005-06-16 08:54:09 +04:00
<note > <para >
On SYSV systems which use lpstat to determine what printers are defined on the system you may be able to use
2005-07-08 14:16:53 +04:00
<literal > printcap name = lpstat</literal> to automatically obtain a list of printers. See the
<literal > printcap name</literal> option for more details.
2005-06-16 08:54:09 +04:00
</para> </note>
2005-05-21 04:23:25 +04:00
</refsect2>
</refsect1>
2006-05-09 03:21:03 +04:00
<refsect1 >
<title > USERSHARES</title>
<para > Starting with Samba version 3.0.23 the capability for non-root users to add, modify, and delete
their own share definitions has been added. This capability is called <emphasis > usershares</emphasis> and
2007-02-01 12:03:19 +03:00
is controlled by a set of parameters in the [global] section of the smb.conf.
2006-05-09 04:31:21 +04:00
The relevant parameters are :
2006-05-09 03:21:03 +04:00
</para>
<variablelist >
<varlistentry >
<term > usershare allow guests</term>
<listitem > <para > Controls if usershares can permit guest access.</para> </listitem>
</varlistentry>
<varlistentry >
<term > usershare max shares</term>
<listitem > <para > Maximum number of user defined shares allowed.</para> </listitem>
</varlistentry>
<varlistentry >
<term > usershare owner only</term>
<listitem > <para > If set only directories owned by the sharing user can be shared.</para> </listitem>
</varlistentry>
<varlistentry >
<term > usershare path</term>
<listitem > <para > Points to the directory containing the user defined share definitions.
The filesystem permissions on this directory control who can create user defined shares.</para> </listitem>
</varlistentry>
<varlistentry >
<term > usershare prefix allow list</term>
2007-02-01 12:03:19 +03:00
<listitem > <para > Comma-separated list of absolute pathnames restricting what directories
2006-05-09 03:21:03 +04:00
can be shared. Only directories below the pathnames in this list are permitted.</para> </listitem>
</varlistentry>
<varlistentry >
<term > usershare prefix deny list</term>
2007-02-01 12:03:19 +03:00
<listitem > <para > Comma-separated list of absolute pathnames restricting what directories
2006-05-09 03:21:03 +04:00
can be shared. Directories below the pathnames in this list are prohibited.</para> </listitem>
</varlistentry>
<varlistentry >
<term > usershare template share</term>
<listitem > <para > Names a pre-existing share used as a template for creating new usershares.
All other share parameters not specified in the user defined share definition
are copied from this named share.</para> </listitem>
</varlistentry>
</variablelist>
<para > To allow members of the UNIX group <literal > foo</literal> to create user defined
shares, create the directory to contain the share definitions as follows:
</para>
<para > Become root:</para>
2006-05-09 04:31:21 +04:00
<programlisting >
mkdir /usr/local/samba/lib/usershares
chgrp foo /usr/local/samba/lib/usershares
chmod 1770 /usr/local/samba/lib/usershares
</programlisting>
2021-10-06 15:01:42 +03:00
<para > Then add the parameters
2006-05-09 04:31:21 +04:00
<programlisting >
<smbconfoption name= "usershare path" > /usr/local/samba/lib/usershares</smbconfoption>
<smbconfoption name= "usershare max shares" > 10</smbconfoption> # (or the desired number of shares)
2021-10-06 15:01:42 +03:00
</programlisting>
2006-05-09 04:31:21 +04:00
to the global
section of your <filename > smb.conf</filename> . Members of the group foo may then manipulate the user defined shares
2006-05-09 03:21:03 +04:00
using the following commands.</para>
<variablelist >
<varlistentry >
<term > net usershare add sharename path [comment] [acl] [guest_ok=[y|n]]</term>
<listitem > <para > To create or modify (overwrite) a user defined share.</para> </listitem>
</varlistentry>
<varlistentry >
<term > net usershare delete sharename</term>
<listitem > <para > To delete a user defined share.</para> </listitem>
</varlistentry>
<varlistentry >
<term > net usershare list wildcard-sharename</term>
<listitem > <para > To list user defined shares.</para> </listitem>
</varlistentry>
<varlistentry >
<term > net usershare info wildcard-sharename</term>
<listitem > <para > To print information about user defined shares.</para> </listitem>
</varlistentry>
</variablelist>
</refsect1>
2021-10-06 15:01:42 +03:00
2005-05-21 04:23:25 +04:00
<refsect1 >
<title > PARAMETERS</title>
<para > Parameters define the specific attributes of sections.</para>
2005-06-16 08:54:09 +04:00
<para >
Some parameters are specific to the [global] section (e.g., <emphasis > security</emphasis> ). Some parameters
2005-07-08 14:16:53 +04:00
are usable in all sections (e.g., <emphasis > create mask</emphasis> ). All others are permissible only in normal
2005-06-16 08:54:09 +04:00
sections. For the purposes of the following descriptions the [homes] and [printers] sections will be
considered normal. The letter <emphasis > G</emphasis> in parentheses indicates that a parameter is specific to
the [global] section. The letter <emphasis > S</emphasis> indicates that a parameter can be specified in a
service specific section. All <emphasis > S</emphasis> parameters can also be specified in the [global] section
- in which case they will define the default behavior for all services.
</para>
<para >
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.
</para>
2005-05-21 04:23:25 +04:00
</refsect1>
<refsect1 >
<title > VARIABLE SUBSTITUTIONS</title>
2005-06-16 08:54:09 +04:00
<para >
Many of the strings that are settable in the config file can take substitutions. For example the option
<quote > path = /tmp/%u</quote> is interpreted as <quote > path = /tmp/john</quote> if the user connected with the
username john.
</para>
2005-05-21 04:23:25 +04:00
2005-06-16 08:54:09 +04:00
<para >
These substitutions are mostly noted in the descriptions below, but there are some general substitutions
which apply whenever they might be relevant. These are:
</para>
2005-05-21 04:23:25 +04:00
<variablelist >
<varlistentry >
<term > %U</term>
2005-06-16 08:54:09 +04:00
<listitem > <para > session username (the username that the client wanted, not
necessarily the same as the one they got).</para> </listitem>
2005-05-21 04:23:25 +04:00
</varlistentry>
2021-10-06 15:01:42 +03:00
2005-05-21 04:23:25 +04:00
<varlistentry >
<term > %G</term>
<listitem > <para > primary group name of %U.</para> </listitem>
</varlistentry>
<varlistentry >
<term > %h</term>
2005-06-16 08:54:09 +04:00
<listitem > <para > the Internet hostname that Samba is running on.</para> </listitem>
2005-05-21 04:23:25 +04:00
</varlistentry>
<varlistentry >
<term > %m</term>
2005-07-18 16:38:57 +04:00
<listitem > <para > the NetBIOS name of the client machine (very useful).</para>
2005-05-21 04:23:25 +04:00
2005-06-16 08:54:09 +04:00
<para > This parameter is not available when Samba listens on port 445, as clients no longer
2005-07-01 03:20:37 +04:00
send this information. If you use this macro in an include statement on a domain that has
a Samba domain controller be sure to set in the [global] section <parameter > smb ports =
139</parameter> . This will cause Samba to not listen on port 445 and will permit include
functionality to function as it did with Samba 2.x.
2005-06-16 08:54:09 +04:00
</para> </listitem>
2005-05-21 04:23:25 +04:00
</varlistentry>
2021-10-06 15:01:42 +03:00
2005-07-18 16:38:57 +04:00
<varlistentry >
<term > %L</term>
<listitem > <para > 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 <quote > dual personality</quote> .
</para> </listitem>
</varlistentry>
2021-10-06 15:01:42 +03:00
2005-05-21 04:23:25 +04:00
<varlistentry >
<term > %M</term>
<listitem > <para > the Internet name of the client machine.
</para> </listitem>
</varlistentry>
2021-10-06 15:01:42 +03:00
2005-05-21 04:23:25 +04:00
<varlistentry >
<term > %R</term>
2015-03-04 09:02:38 +03:00
<listitem > <para > the selected protocol level after protocol negotiation. It can be one of
CORE, COREPLUS, LANMAN1, LANMAN2, NT1,
2021-07-09 13:03:06 +03:00
SMB2_02, SMB2_10, SMB3_00, SMB3_02, SMB3_11
2015-03-04 09:02:38 +03:00
or SMB2_FF.</para> </listitem>
2005-05-21 04:23:25 +04:00
</varlistentry>
<varlistentry >
<term > %d</term>
<listitem > <para > the process id of the current server
2005-06-16 08:54:09 +04:00
process.</para> </listitem>
2005-05-21 04:23:25 +04:00
</varlistentry>
2021-10-06 15:01:42 +03:00
2005-05-21 04:23:25 +04:00
<varlistentry >
<term > %a</term>
2008-04-01 00:38:37 +04:00
<listitem > <para >
The architecture of the remote
2021-10-06 15:01:42 +03:00
machine. It currently recognizes Samba (<constant > Samba</constant> ),
2008-04-01 00:38:37 +04:00
the Linux CIFS file system (<constant > CIFSFS</constant> ), OS/2, (<constant > OS2</constant> ),
2021-10-06 15:01:42 +03:00
Mac OS X (<constant > OSX</constant> ), Windows for Workgroups (<constant > WfWg</constant> ), Windows 9x/ME
2008-04-01 00:38:37 +04:00
(<constant > Win95</constant> ), Windows NT (<constant > WinNT</constant> ),
Windows 2000 (<constant > Win2K</constant> ),
Windows XP (<constant > WinXP</constant> ),
Windows XP 64-bit(<constant > WinXP64</constant> ),
Windows 2003 including
2003R2 (<constant > Win2K3</constant> ), and Windows
2021-10-06 15:01:42 +03:00
Vista (<constant > Vista</constant> ). Anything else will be known as
<constant > UNKNOWN</constant> .</para>
2005-05-21 04:23:25 +04:00
</listitem>
</varlistentry>
2021-10-06 15:01:42 +03:00
2005-05-21 04:23:25 +04:00
<varlistentry >
<term > %I</term>
<listitem > <para > the IP address of the client machine.</para>
2012-09-11 12:50:08 +04:00
<para > Before 4.0.0 it could contain IPv4 mapped IPv6 addresses,
2011-04-25 19:40:25 +04:00
now it only contains IPv4 or IPv6 addresses.</para>
2004-04-07 14:15:11 +04:00
</listitem>
2005-05-21 04:23:25 +04:00
</varlistentry>
2005-05-06 02:38:51 +04:00
2017-07-27 13:54:28 +03:00
<varlistentry >
<term > %J</term>
<listitem > <para > the IP address of the client machine,
colons/dots replaced by underscores.</para>
</listitem>
</varlistentry>
2005-05-21 04:23:25 +04:00
<varlistentry >
<term > %i</term>
<listitem > <para > the local IP address to which a client connected.</para>
2012-09-11 12:50:08 +04:00
<para > Before 4.0.0 it could contain IPv4 mapped IPv6 addresses,
2011-04-25 19:40:25 +04:00
now it only contains IPv4 or IPv6 addresses.</para>
2004-04-07 14:15:11 +04:00
</listitem>
2005-05-21 04:23:25 +04:00
</varlistentry>
2017-07-27 13:54:28 +03:00
<varlistentry >
<term > %j</term>
<listitem > <para > the local IP address to which a client connected,
colons/dots replaced by underscores.</para>
</listitem>
</varlistentry>
2005-05-21 04:23:25 +04:00
<varlistentry >
<term > %T</term>
<listitem > <para > the current date and time.</para> </listitem>
</varlistentry>
2017-07-27 13:54:28 +03:00
<varlistentry >
<term > %t</term>
<listitem > <para > the current date and time in a minimal format without colons (YYYYYmmdd_HHMMSS).</para> </listitem>
</varlistentry>
2005-05-21 04:23:25 +04:00
<varlistentry >
<term > %D</term>
<listitem > <para > name of the domain or workgroup of the current user.</para> </listitem>
</varlistentry>
2021-10-06 15:01:42 +03:00
2006-01-20 23:25:40 +03:00
<varlistentry >
<term > %w</term>
2006-01-23 12:56:04 +03:00
<listitem > <para > the winbind separator.</para> </listitem>
2006-01-20 23:25:40 +03:00
</varlistentry>
2021-10-06 15:01:42 +03:00
2005-05-21 04:23:25 +04:00
<varlistentry >
<term > %$(<replaceable > envvar</replaceable> )</term>
<listitem > <para > the value of the environment variable
<replaceable > envar</replaceable> .</para> </listitem>
</varlistentry>
</variablelist>
2005-06-16 08:54:09 +04:00
<para >
The following substitutes apply only to some configuration options (only those that are
used when a connection has been established):
</para>
2005-05-21 04:23:25 +04:00
<variablelist >
<varlistentry >
<term > %S</term>
<listitem > <para > the name of the current service, if any.</para>
2005-05-06 02:38:51 +04:00
</listitem>
2005-05-21 04:23:25 +04:00
</varlistentry>
2021-10-06 15:01:42 +03:00
2005-05-21 04:23:25 +04:00
<varlistentry >
<term > %P</term>
2005-06-16 08:54:09 +04:00
<listitem > <para > the root directory of the current service, if any.</para> </listitem>
2005-05-21 04:23:25 +04:00
</varlistentry>
2021-10-06 15:01:42 +03:00
2005-05-21 04:23:25 +04:00
<varlistentry >
<term > %u</term>
<listitem > <para > username of the current service, if any.</para>
2005-05-06 02:38:51 +04:00
</listitem>
2005-05-21 04:23:25 +04:00
</varlistentry>
2021-10-06 15:01:42 +03:00
2005-05-21 04:23:25 +04:00
<varlistentry >
<term > %g</term>
<listitem > <para > primary group name of %u.</para> </listitem>
</varlistentry>
2021-10-06 15:01:42 +03:00
2005-05-21 04:23:25 +04:00
<varlistentry >
<term > %H</term>
2005-06-16 08:54:09 +04:00
<listitem > <para > the home directory of the user given by %u.</para> </listitem>
2005-05-21 04:23:25 +04:00
</varlistentry>
<varlistentry >
<term > %N</term>
2021-04-21 11:22:29 +03:00
<listitem > <para > This value is the same as %L.</para> </listitem>
2005-05-21 04:23:25 +04:00
</varlistentry>
</variablelist>
2021-10-06 15:01:42 +03:00
2005-06-16 08:54:09 +04:00
<para >
There are some quite creative things that can be done with these substitutions and other
<filename moreinfo= "none" > smb.conf</filename> options.
</para>
2005-05-21 04:23:25 +04:00
</refsect1>
2005-05-06 02:38:51 +04:00
2005-05-21 04:23:25 +04:00
<refsect1 id= "NAMEMANGLINGSECT" >
<title > NAME MANGLING</title>
2021-10-06 15:01:42 +03:00
2005-06-16 08:54:09 +04:00
<para >
Samba supports <literal > name mangling</literal> 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.
</para>
2005-05-06 02:38:51 +04:00
2005-06-16 08:54:09 +04:00
<para >
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.
</para>
2005-05-06 02:38:51 +04:00
2005-06-16 08:54:09 +04:00
<para >
2006-11-24 23:22:57 +03:00
These options can be set separately for each service.
2005-06-16 08:54:09 +04:00
</para>
2005-05-06 02:38:51 +04:00
2005-06-16 08:54:09 +04:00
<para >
The options are:
</para>
2021-10-06 15:01:42 +03:00
2005-05-21 04:23:25 +04:00
<variablelist >
2021-10-06 15:01:42 +03:00
2005-05-21 04:23:25 +04:00
<varlistentry >
<term > case sensitive = yes/no/auto</term>
2005-06-16 08:54:09 +04:00
<listitem > <para >
controls whether filenames are case sensitive. If they aren't, Samba must do a filename search and match on
passed names. The default setting of auto allows clients that support case sensitive filenames (Linux CIFSVFS
and smbclient 3.0.5 and above currently) to tell the Samba server on a per-packet basis that they wish to
access the file system in a case-sensitive manner (to support UNIX case sensitive semantics). No Windows or
2023-11-13 09:58:19 +03:00
DOS system supports case-sensitive filename so setting this option to auto is the same as setting it to no
2005-06-16 08:54:09 +04:00
for them. Default <emphasis > auto</emphasis> .
</para> </listitem>
2021-10-06 15:01:42 +03:00
</varlistentry>
2005-05-21 04:23:25 +04:00
<varlistentry >
<term > default case = upper/lower</term>
2005-06-16 08:54:09 +04:00
<listitem > <para >
2005-11-28 23:33:34 +03:00
controls what the default case is for new filenames (ie. files that don't currently exist in the filesystem).
2010-06-30 15:25:28 +04:00
Default <emphasis > lower</emphasis> . IMPORTANT NOTE: As part of the optimizations for directories containing
large numbers of files, the following special case applies. If the options
<smbconfoption name= "case sensitive" > yes</smbconfoption> , <smbconfoption name= "preserve case" > No</smbconfoption> , and
<smbconfoption name= "short preserve case" > No</smbconfoption> are set, then the case of <emphasis > all</emphasis>
incoming client filenames, not just new filenames, will be modified. See additional notes below.
2005-06-16 08:54:09 +04:00
</para> </listitem>
2021-10-06 15:01:42 +03:00
</varlistentry>
2005-05-21 04:23:25 +04:00
<varlistentry >
<term > preserve case = yes/no</term>
2005-06-16 08:54:09 +04:00
<listitem > <para >
2005-11-28 23:33:34 +03:00
controls whether new files (ie. files that don't currently exist in the filesystem) are created with the case
that the client passes, or if they are forced to be the <literal > default</literal> case. Default
<emphasis > yes</emphasis> .
2005-05-21 04:23:25 +04:00
</para> </listitem>
2021-10-06 15:01:42 +03:00
</varlistentry>
2005-05-21 04:23:25 +04:00
<varlistentry >
<term > short preserve case = yes/no</term>
2005-06-16 08:54:09 +04:00
<listitem > <para >
2005-11-28 23:33:34 +03:00
controls if new files (ie. files that don't currently exist in the filesystem) 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
<literal > default</literal> case. This option can be used with <literal > preserve case = yes</literal> to permit
long filenames to retain their case, while short names are lowercased. Default <emphasis > yes</emphasis> .
2005-06-16 08:54:09 +04:00
</para> </listitem>
2021-10-06 15:01:42 +03:00
</varlistentry>
2005-05-21 04:23:25 +04:00
</variablelist>
2021-10-06 15:01:42 +03:00
2005-06-16 08:54:09 +04:00
<para >
2005-11-28 23:15:21 +03:00
By default, Samba 3.0 has the same semantics as a Windows NT server, in that it is case insensitive
but case preserving. As a special case for directories with large numbers of files, if the case
options are set as follows, "case sensitive = yes", "case preserve = no", "short preserve case = no"
then the "default case" option will be applied and will modify all filenames sent from the client
when accessing this share.
2005-06-16 08:54:09 +04:00
</para>
2021-10-06 15:01:42 +03:00
2005-05-21 04:23:25 +04:00
</refsect1>
2007-06-23 02:44:13 +04:00
<refsect1 >
<title > REGISTRY-BASED CONFIGURATION</title>
<para >
2007-10-17 15:03:00 +04:00
Starting with Samba version 3.2.0, the capability to
2008-01-16 20:26:57 +03:00
store Samba configuration in the registry is available.
2008-04-24 13:23:36 +04:00
The configuration is stored in the registry key
<emphasis > <literal > HKLM\Software\Samba\smbconf</literal> </emphasis> .
2008-01-18 13:19:31 +03:00
There are two levels of registry configuration:
2007-06-23 02:44:13 +04:00
</para>
<orderedlist continuation= "restarts" inheritnum= "ignore" numeration= "arabic" >
<listitem > <para > Share definitions stored in registry are used.
2021-10-06 15:01:42 +03:00
This is triggered by setting the global
2008-04-24 13:23:36 +04:00
parameter <parameter > registry shares</parameter>
to <quote > yes</quote> in <emphasis > smb.conf</emphasis> .
2007-06-23 02:44:13 +04:00
</para>
2007-06-26 12:11:40 +04:00
2008-04-24 13:23:36 +04:00
<para > The registry shares are loaded not at startup but
on demand at runtime by <emphasis > smbd</emphasis> .
Shares defined in <emphasis > smb.conf</emphasis> take
priority over shares of the same name defined in
registry.</para> </listitem>
<listitem >
<para > Global <emphasis > smb.conf</emphasis>
options stored in registry are used. This can be activated
in two different ways:</para>
<para > Firstly, a registry only configuration is triggered
by setting
<smbconfoption name= "config backend" > registry</smbconfoption>
in the [global] section of <emphasis > smb.conf</emphasis> .
This resets everything that has been read from config files
2008-01-18 13:19:31 +03:00
to this point and reads the content of the global configuration
section from the registry.
2008-04-24 13:23:36 +04:00
This is the recommended method of using registry based
configuration.</para>
<para > Secondly, a mixed configuration can be activated
by a special new meaning of the parameter
<smbconfoption name= "include" > registry</smbconfoption>
in the [global] section of <emphasis > smb.conf</emphasis> .
This reads the global options from registry with the same
priorities as for an include of a text file.
This may be especially useful in cases where an initial
configuration is needed to access the registry.</para>
<para > Activation of global registry options automatically
activates registry shares. So in the registry only case,
shares are loaded on demand only.</para>
</listitem>
2007-06-23 02:44:13 +04:00
</orderedlist>
<para >
2008-04-24 13:23:36 +04:00
Note: To make registry-based configurations foolproof
at least to a certain extent, the use
of <parameter > lock directory</parameter> and
<parameter > config backend</parameter>
inside the registry configuration has been disabled:
Especially by changing the
2008-01-18 13:19:31 +03:00
<parameter > lock directory</parameter> inside the registry
2007-06-23 02:44:13 +04:00
configuration, one would create a broken setup where the daemons
2008-01-16 20:26:57 +03:00
do not see the configuration they loaded once it is active.
2007-06-23 02:44:13 +04:00
</para>
<para >
The registry configuration can be accessed with
2008-04-24 13:23:36 +04:00
tools like <emphasis > regedit</emphasis> or <emphasis > net (rpc)
2007-06-26 12:11:40 +04:00
registry</emphasis> in the key
2008-04-07 09:43:55 +04:00
<emphasis > <literal > HKLM\Software\Samba\smbconf</literal> </emphasis> .
2007-06-23 02:44:13 +04:00
2007-06-26 12:11:40 +04:00
More conveniently, the <emphasis > conf</emphasis> subcommand of the
2008-01-18 13:19:31 +03:00
<citerefentry > <refentrytitle > net</refentrytitle>
2007-06-29 00:32:38 +04:00
<manvolnum > 8</manvolnum> </citerefentry> utility
2007-06-23 02:44:13 +04:00
offers a dedicated interface to read and write the
registry based configuration locally, i.e. directly
2007-06-26 12:11:40 +04:00
accessing the database file, circumventing the
server.
2007-06-23 02:44:13 +04:00
</para>
</refsect1>
2016-12-08 11:21:53 +03:00
<refsect1 ID= "IDMAPCONSIDERATIONS" >
<title > IDENTITY MAPPING CONSIDERATIONS</title>
<para >
In the SMB protocol, users, groups, and machines are represented by their security identifiers (SIDs).
On POSIX system Samba processes need to run under corresponding POSIX user identities and
with supplemental POSIX groups to allow access to the files owned by those users and groups.
The process of mapping SIDs to POSIX users and groups is called <emphasis > IDENTITY MAPPING</emphasis>
or, in short, <emphasis > ID MAPPING</emphasis> .
</para>
<para >
Samba supports multiple ways to map SIDs to POSIX users and groups. The configuration is driven by
the <smbconfoption name= "idmap config DOMAIN : OPTION" /> option which allows one to specify identity
mapping (idmap) options for each domain separately.
</para>
<para >
Identity mapping modules implement different strategies for mapping of SIDs to POSIX user and group
identities. They are applicable to different use cases and scenarios. It is advised to read the documentation
of the individual identity mapping modules before choosing a specific scenario to use. Each identity
management module is documented in a separate manual page. The standard idmap backends are
tdb (<citerefentry > <refentrytitle > idmap_tdb</refentrytitle> <manvolnum > 8</manvolnum> </citerefentry> ),
tdb2 (<citerefentry > <refentrytitle > idmap_tdb2</refentrytitle> <manvolnum > 8</manvolnum> </citerefentry> ),
ldap (<citerefentry > <refentrytitle > idmap_ldap</refentrytitle> <manvolnum > 8</manvolnum> </citerefentry> ),
rid (<citerefentry > <refentrytitle > idmap_rid</refentrytitle> <manvolnum > 8</manvolnum> </citerefentry> ),
hash (<citerefentry > <refentrytitle > idmap_hash</refentrytitle> <manvolnum > 8</manvolnum> </citerefentry> ),
autorid (<citerefentry > <refentrytitle > idmap_autorid</refentrytitle> <manvolnum > 8</manvolnum> </citerefentry> ),
ad (<citerefentry > <refentrytitle > idmap_ad</refentrytitle> <manvolnum > 8</manvolnum> </citerefentry> ),
nss (<citerefentry > <refentrytitle > idmap_nss</refentrytitle> <manvolnum > 8</manvolnum> </citerefentry> ), and
rfc2307 (<citerefentry > <refentrytitle > idmap_rfc2307</refentrytitle> <manvolnum > 8</manvolnum> </citerefentry> ).
</para>
<para >
Overall, ID mapping configuration should be decided carefully. Changes to the already deployed ID mapping
configuration may create the risk of losing access to the data or disclosing the data to the wrong parties.
</para>
<para >
This example shows how to configure two domains with <citerefentry > <refentrytitle > idmap_rid</refentrytitle>
<manvolnum > 8</manvolnum> </citerefentry> , the principal domain and a trusted domain,
leaving the default id mapping scheme at tdb.
</para>
<programlisting >
[global]
security = domain
workgroup = MAIN
idmap config * : backend = tdb
idmap config * : range = 1000000-1999999
idmap config MAIN : backend = rid
idmap config MAIN : range = 5000000-5999999
idmap config TRUSTED : backend = rid
idmap config TRUSTED : range = 6000000-6999999
</programlisting>
</refsect1>
2005-05-21 04:23:25 +04:00
<refsect1 >
<title > EXPLANATION OF EACH PARAMETER</title>
2021-10-06 15:01:42 +03:00
2005-07-05 04:19:04 +04:00
<samba:parameterlist >
2012-09-17 14:07:26 +04:00
<!-- The URI below is resolved to local generated version of parameters.all.xml // -->
<!-- WAF build places it in bin/default/docs - xml/smbdotconf/parameters.all.xml // -->
<!-- and we redirect there via use of XML_CATALOG_FILES, see docs - xml/build/catalog.xml.in // -->
<xi:include href= "http://www.samba.org/samba/smbdotconf/parameters.all.xml" parse= "xml" />
2005-07-05 04:19:04 +04:00
</samba:parameterlist>
2005-05-06 02:38:51 +04:00
2005-05-21 04:23:25 +04:00
</refsect1>
2005-05-06 02:38:51 +04:00
2005-05-21 04:23:25 +04:00
<refsect1 >
<title > WARNINGS</title>
2021-10-06 15:01:42 +03:00
2005-06-16 08:54:09 +04:00
<para >
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.
</para>
<para >
On a similar note, many clients - especially DOS clients - limit service names to eight characters.
<citerefentry > <refentrytitle > smbd</refentrytitle> <manvolnum > 8</manvolnum> </citerefentry> 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.
</para>
<para >
2021-10-06 15:01:42 +03:00
Use of the <literal > [homes]</literal> and <literal > [printers]</literal> special sections make life
2005-06-16 08:54:09 +04:00
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.
</para>
2005-05-21 04:23:25 +04:00
</refsect1>
<refsect1 >
<title > VERSION</title>
2017-12-13 03:38:25 +03:00
<para > This man page is part of version &doc.version; of the Samba suite.</para>
2005-05-21 04:23:25 +04:00
</refsect1>
<refsect1 >
<title > SEE ALSO</title>
<para >
<citerefentry > <refentrytitle > samba</refentrytitle>
<manvolnum > 7</manvolnum> </citerefentry> , <citerefentry > <refentrytitle > smbpasswd</refentrytitle>
<manvolnum > 8</manvolnum> </citerefentry> , <citerefentry > <refentrytitle > smbd</refentrytitle>
<manvolnum > 8</manvolnum> </citerefentry> , <citerefentry > <refentrytitle > nmbd</refentrytitle>
2012-11-27 14:46:38 +04:00
<manvolnum > 8</manvolnum> </citerefentry> , <citerefentry > <refentrytitle > winbindd</refentrytitle>
<manvolnum > 8</manvolnum> </citerefentry> , <citerefentry > <refentrytitle > samba</refentrytitle>
<manvolnum > 8</manvolnum> </citerefentry> , <citerefentry > <refentrytitle > samba-tool</refentrytitle>
2005-05-21 04:23:25 +04:00
<manvolnum > 8</manvolnum> </citerefentry> , <citerefentry > <refentrytitle > smbclient</refentrytitle>
<manvolnum > 1</manvolnum> </citerefentry> , <citerefentry > <refentrytitle > nmblookup</refentrytitle>
<manvolnum > 1</manvolnum> </citerefentry> , <citerefentry > <refentrytitle > testparm</refentrytitle>
<manvolnum > 1</manvolnum> </citerefentry> .</para>
</refsect1>
<refsect1 >
<title > AUTHOR</title>
2021-10-06 15:01:42 +03:00
2005-06-16 08:54:09 +04:00
<para >
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.
</para>
2005-05-21 04:23:25 +04:00
</refsect1>
</refentry>