1 .TH SMB.CONF 5 smb.conf smb.conf
3 smb.conf \- configuration file for smbd
9 file is a configuration file for the Samba suite.
12 contains runtime configuration information for the
16 program provides LanManager-like services to clients
17 using the SMB protocol.
19 The file consists of sections and parameters. A section begins with the
20 name of the section in square brackets and continues until the next
21 section begins. Sections contain parameters of the form 'name = value'.
23 The file is line-based - that is, each newline-terminated line represents
24 either a comment, a section name or a parameter.
26 Section and parameter names are not case sensitive.
28 Only the first equals sign in a parameter is significant. Whitespace before
29 or after the first equals sign is discarded. Leading, trailing and internal
30 whitespace in section and parameter names is irrelevant. Leading and
31 trailing whitespace in a parameter value is discarded. Internal whitespace
32 within a parameter value is retained verbatim.
34 Any line beginning with a semicolon is ignored, as are lines containing
37 Any line ending in a \e is "continued" on the next line in the
38 customary UNIX fashion.
40 The values following the equals sign in parameters are all either a string
41 (no quotes needed) or a boolean, which may be given as yes/no, 0/1 or
42 true/false. Case is not significant in boolean values, but is preserved
43 in string values. Some items such as create modes are numeric.
44 .SH SERVICE DESCRIPTIONS
45 Each section in the configuration file describes a service. The section name
46 is the service name and the parameters within the section define the service's
49 There are three special sections, [global], [homes] and [printers], which are
50 described under 'special sections'. The following notes apply to ordinary
53 A service consists of a directory to which access is being given plus a
54 description of the access rights which are granted to the user of the
55 service. Some housekeeping options are also specifiable.
57 Services are either filespace services (used by the client as an extension of
58 their native file systems) or printable services (used by the client to access
59 print services on the host running the server).
61 Services may be guest services, in which case no password is required to
62 access them. A specified guest account is used to define access privileges
65 Services other than guest services will require a password to access
66 them. The client provides the username. As many clients only provide
67 passwords and not usernames, you may specify a list of usernames to
68 check against the password using the "user=" option in the service
71 Note that the access rights granted by the server are masked by the access
72 rights granted to the specified or guest user by the host system. The
73 server does not grant more access than the host system grants.
75 The following sample section defines a file space service. The user has write
76 access to the path /home/bar. The service is accessed via the service name
83 The following sample section defines a printable service. The service is
84 readonly, but printable. That is, the only write access permitted is via
85 calls to open, write to and close a spool file. The 'guest ok' parameter
86 means access will be permitted as the default guest user (specified elsewhere):
89 path = /usr/spool/public
95 .SS The [global] section
97 Parameters in this section apply to the server as a whole, or are defaults
98 for services which do not specifically define certain items. See the notes
99 under 'Parameters' for more information.
102 .SS The [homes] section
104 If a section called 'homes' is included in the configuration file, services
105 connecting clients to their home directories can be created on the fly by the
108 When the connection request is made, the existing services are scanned. If a
109 match is found, it is used. If no match is found, the requested service name is
110 treated as a user name and looked up in the local passwords file. If the
111 name exists and the correct password has been given, a service is created
112 by cloning the [homes] section.
114 Some modifications are then made to the newly created section:
117 The service name is changed from 'homes' to the located username
119 If no path was given, the path is set to the user's home directory.
122 If you decide to use a path= line in your [homes] section then you may
123 find it useful to use the %S macro. For example path=/data/pchome/%S
124 would be useful if you have different home directories for your PCs
125 than for UNIX access.
127 This is a fast and simple way to give a large number of clients access to
128 their home directories with a minimum of fuss.
130 A similar process occurs if the requested service name is "homes", except that
131 the service name is not changed to that of the requesting user. This method
132 of using the [homes] section works well if different users share a client PC.
134 The [homes] section can specify all the parameters a normal service section
135 can specify, though some make more sense than others. The following is a
136 typical and suitable [homes] section:
144 If guest access is specified in the [homes] section, all home directories will
145 be accessible to all clients
146 .B without a password.
147 In the very unlikely event
148 that this is actually desirable, it would be wise to also specify read only
153 Note that the browseable flag for auto home directories will be
154 inherited from the global browseable flag, not the [homes] browseable
155 flag. This is useful as it means setting browseable=no in the [homes]
156 section will hide the [homes] service but make any auto home
159 .SS The [printers] section
161 This section works like [homes], but for printers.
163 If a [printers] section occurs in the configuration file, users are able
164 to connect to any printer specified in the local host's printcap file.
166 When a connection request is made, the existing services are scanned. If a
167 match is found, it is used. If no match is found, but a [homes] section
168 exists, it is used as described above. Otherwise, the requested service name is
169 treated as a printer name and the appropriate printcap file is scanned to
170 see if the requested service name is a valid printer name. If a match is
171 found, a new service is created by cloning the [printers] section.
173 A few modifications are then made to the newly created section:
176 The service name is set to the located printer name
178 If no printer name was given, the printer name is set to the located printer
181 If the service does not permit guest access and no username was given, the
182 username is set to the located printer name.
185 Note that the [printers] service MUST be printable - if you specify otherwise,
186 the server will refuse to load the configuration file.
188 Typically the path specified would be that of a world-writable spool directory
189 with the sticky bit set on it. A typical [printers] entry would look like this:
192 path = /usr/spool/public
197 All aliases given for a printer in the printcap file are legitimate printer
198 names as far as the server is concerned. If your printing subsystem doesn't
199 work like that, you will have to set up a pseudo-printcap. This is a file
200 consisting of one or more lines like this:
202 alias|alias|alias|alias...
204 Each alias should be an acceptable printer name for your printing
205 subsystem. In the [global] section, specify the new file as your printcap.
206 The server will then only recognise names found in your pseudo-printcap,
207 which of course can contain whatever aliases you like. The same technique
208 could be used simply to limit access to a subset of your local printers.
210 An alias, by the way, is defined as any component of the first entry of a
211 printcap record. Records are separated by newlines, components (if there are
212 more than one) are separated by vertical bar symbols ("|").
215 Parameters define the specific attributes of services.
217 Some parameters are specific to the [global] section (eg., security).
218 Some parameters are usable in all sections (eg., create mode). All others are
219 permissible only in normal sections. For the purposes of the following
220 descriptions the [homes] and [printers] sections will be considered normal.
221 The letter 'G' in parentheses indicates that a parameter is specific to the
222 [global] section. The letter 'S' indicates that a parameter can be
223 specified in a service specific section. Note that all S parameters
224 can also be specified in the [global] section - in which case they
225 will define the default behaviour for all services.
227 Parameters are arranged here in alphabetical order - this may not create
228 best bedfellows, but at least you can find them! Where there are synonyms,
229 the preferred synonym is described, others refer to the preferred synonym.
231 .SS VARIABLE SUBSTITUTIONS
233 Many of the strings that are settable in the config file can take
234 substitutions. For example the option "path = /tmp/%u" would be
235 interpreted as "path = /tmp/john" if the user connected with the
238 These substitutions are mostly noted in the descriptions below, but
239 there are some general substitutions which apply whenever they might be
242 %S = the name of the current service, if any
244 %P = the root directory of the current service, if any
246 %u = user name of the current service, if any
248 %g = primary group name of %u
250 %U = session user name (the user name that the client wanted, not
251 necessarily the same as the one they got)
253 %G = primary group name of %U
255 %H = the home directory of the user given by %u
257 %v = the Samba version
259 %h = the hostname that Samba is running on
261 %m = the netbios name of the client machine (very useful)
263 %L = the netbios name of the server. This allows you to change your
264 config based on what the client calls you. Your server can have a "dual
267 %M = the internet name of the client machine
269 %d = The process id of the current server process
271 %a = the architecture of the remote machine. Only some are recognised,
272 and those may not be 100% reliable. It currently recognises Samba,
273 WfWg, WinNT and Win95. Anything else will be known as "UNKNOWN". If it
274 gets it wrong then sending me a level 3 log should allow me to fix it.
276 %I = The IP address of the client machine
278 %T = the current date and time
280 There are some quite creative things that can be done with these
281 substitutions and other smb.conf options.
285 Samba supports "name mangling" so that DOS and Windows clients can use
286 files that don't conform to the 8.3 format. It can also be set to adjust
287 the case of 8.3 format filenames.
289 There are several options that control the way mangling is performed,
290 and they are grouped here rather than listed separately. For the
291 defaults look at the output of the testparm program.
293 All of these options can be set separately for each service (or
294 globally, of course).
298 "mangle case = yes/no" controls if names that have characters that
299 aren't of the "default" case are mangled. For example, if this is yes
300 then a name like "Mail" would be mangled. Default no.
302 "case sensitive = yes/no" controls whether filenames are case
303 sensitive. If they aren't then Samba must do a filename search and
304 match on passed names. Default no.
306 "default case = upper/lower" controls what the default case is for new
307 filenames. Default lower.
309 "preserve case = yes/no" controls if new files are created with the
310 case that the client passes, or if they are forced to be the "default"
313 "short preserve case = yes/no" controls if new files which conform to 8.3
314 syntax, that is all in upper case and of suitable length, are created
315 upper case, or if they are forced to be the "default" case. This option can
316 be use with "preserve case = yes" to permit long filenames to retain their
317 case, while short names are lowered. Default no.
319 .SS COMPLETE LIST OF GLOBAL PARAMETERS
321 Here is a list of all global parameters. See the section of each
322 parameter for details. Note that some are synonyms.
438 .SS COMPLETE LIST OF SERVICE PARAMETERS
440 Here is a list of all service parameters. See the section of each
441 parameter for details. Note that some are synonyms.
447 alternate permissions
593 .SS EXPLANATION OF EACH PARAMETER
598 This is a list of users who will be granted administrative privileges
599 on the share. This means that they will do all file operations as the
602 You should use this option very carefully, as any user in this list
603 will be able to do anything they like on the share, irrespective of
612 .SS auto services (G)
613 This is a list of services that you want to be automatically added to
614 the browse lists. This is most useful for homes and printers services
615 that would otherwise not be visible.
617 Note that if you just want all printers in your printcap file loaded
618 then the "load printers" option is easier.
624 auto services = fred lp colorlp
627 A synonym for this parameter is 'hosts allow'.
629 This parameter is a comma delimited set of hosts which are permitted to access
630 a services. If specified in the [global] section, matching hosts will be
631 allowed access to any service that does not specifically exclude them from
632 access. Specific services my have their own list, which override those
633 specified in the [global] section.
635 You can specify the hosts by name or IP number. For example, you could
636 restrict access to only the hosts on a Class C subnet with something like
637 "allow hosts = 150.203.5.". The full syntax of the list is described in
639 .BR hosts_access (5).
641 You can also specify hosts by network/netmask pairs and by netgroup
642 names if your system supports netgroups. The EXCEPT keyword can also
643 be used to limit a wildcard list. The following examples may provide
646 Example 1: allow all IPs in 150.203.*.* except one
648 hosts allow = 150.203. EXCEPT 150.203.6.66
650 Example 2: allow hosts that match the given network/netmask
652 hosts allow = 150.203.15.0/255.255.255.0
654 Example 3: allow a couple of hosts
656 hosts allow = lapland, arvidsjaur
658 Example 4: allow only hosts in netgroup "foonet" or localhost, but
659 deny access from one particular host
661 hosts allow = @foonet, localhost
664 Note that access still requires suitable user-level passwords.
668 for a way of testing your host access to see if it
669 does what you expect.
672 none (i.e., all hosts permitted access)
675 allow hosts = 150.203.5. myhost.mynet.edu.au
677 .SS alternate permissions (S)
679 This option affects the way the "read only" DOS attribute is produced
680 for UNIX files. If this is false then the read only bit is set for
681 files on writeable shares which the user cannot write to.
683 If this is true then it is set for files whos user write bit is not set.
685 The latter behaviour is useful for when users copy files from each
686 others directories, and use a file manager that preserves
687 permissions. Without this option they may get annoyed as all copied
688 files will have the "read only" bit set.
691 alternate permissions = no
694 alternate permissions = yes
697 This parameter lets you 'turn off' a service. If 'available = no', then
698 ALL attempts to connect to the service will fail. Such failures are logged.
706 This controls whether this share is seen in the list of available
707 shares in a net view and in the browse list.
715 .SS case sig names (G)
719 This is a text field that is seen when a client does a net view to
720 list what shares are available. It will also be used when browsing is
727 comment = Fred's Files
731 This allows you to override the config file to use, instead of the
732 default (usually smb.conf). There is a chicken and egg problem here as
733 this option is set in the config file!
735 For this reason, if the name of the config file has changed when the
736 parameters are loaded then it will reload them from the new config
739 This option takes the usual substitutions, which can be very useful.
741 If the config file doesn't exist then it won't be loaded (allowing
742 you to special case the config files of just a few clients).
745 config file = /usr/local/samba/lib/smb.conf.%m
748 This parameter allows you to 'clone' service entries. The specified
749 service is simply duplicated under the current service's name. Any
750 parameters specified in the current section will override those in the
751 section being copied.
753 This feature lets you set up a 'template' service and create similar
754 services easily. Note that the service being copied must occur earlier
755 in the configuration file than the service doing the copying.
763 A synonym for this parameter is 'create mode'.
765 This parameter is the octal modes which are used when converting DOS modes
768 Note that Samba will or this value with 0700 as you must have at least
769 user read, write and execute for Samba to work properly.
780 The value of the parameter (a decimal integer) represents the number of
781 minutes of inactivity before a connection is considered dead, and it
782 is disconnected. The deadtime only takes effect if the number of open files
785 This is useful to stop a server's resources being exhausted by a large
786 number of inactive connections.
788 Most clients have an auto-reconnect feature when a connection is broken so
789 in most cases this parameter should be transparent to users.
791 Using this parameter with a timeout of a few minutes is recommended
794 A deadtime of zero indicates that no auto-disconnection should be performed.
802 The value of the parameter (an integer) allows the debug level
803 (logging level) to be specified in the
805 file. This is to give
806 greater flexibility in the configuration of the system.
808 The default will be the debug level specified on the command line.
817 See the section on "NAME MANGLING" Also note the addition of "short
820 .SS default service (G)
821 A synonym for this parameter is 'default'.
823 This parameter specifies the name of a service which will be connected to
824 if the service actually requested cannot be found. Note that the square
825 brackets are NOT given in the parameter value (see example below).
827 There is no default value for this parameter. If this parameter is not given,
828 attempting to connect to a nonexistent service results in an error.
830 Typically the default service would be a public, read-only service.
832 Also note that as of 1.9.14 the apparent service name will be changed to
833 equal that of the requested service, this is very useful as it allows
834 you to use macros like %S to make a wildcard service.
836 Note also that any _ characters in the name of the service used in the
837 default service will get mapped to a /. This allows for interesting
842 default service = pub
848 .SS delete readonly (S)
849 This parameter allows readonly files to be deleted. This is not normal DOS
850 semantics, but is allowed by UNIX.
852 This option may be useful for running applications such as rcs, where UNIX
853 file ownership prevents changing file permissions, and DOS semantics prevent
854 deletion of a read only file.
860 delete readonly = Yes
862 A synonym for this parameter is 'hosts deny'.
864 The opposite of 'allow hosts' - hosts listed here are NOT permitted
865 access to services unless the specific services have their own lists to
866 override this one. Where the lists conflict, the 'allow' list takes precedence.
869 none (i.e., no hosts specifically excluded)
872 deny hosts = 150.203.4. badhost.mynet.edu.au
873 .SS dfree command (G)
874 The dfree command setting should only be used on systems where a
875 problem occurs with the internal disk space calculations. This has
876 been known to happen with Ultrix, but may occur with other operating
877 systems. The symptom that was seen was an error of "Abort Retry
878 Ignore" at the end of each directory listing.
880 This setting allows the replacement of the internal routines to
881 calculate the total disk space and amount available with an external
882 routine. The example below gives a possible script that might fulfill
885 The external program will be passed a single parameter indicating a
886 directory in the filesystem being queried. This will typically consist
887 of the string "./". The script should return two integers in ascii. The
888 first should be the total disk space in blocks, and the second should
889 be the number of available blocks. An optional third return value
890 can give the block size in bytes. The default blocksize is 1024 bytes.
892 Note: Your script should NOT be setuid or setgid and should be owned by
893 (and writable only by) root!
896 By default internal routines for determining the disk capacity
897 and remaining space will be used.
900 dfree command = /usr/local/samba/bin/dfree
902 Where the script dfree (which must be made executable) could be
906 df $1 | tail -1 | awk '{print $2" "$4}'
909 or perhaps (on Sys V)
913 /usr/bin/df -k $1 | tail -1 | awk '{print $3" "$5}'
916 Note that you may have to replace the command names with full
917 path names on some systems.
922 .SS domain master (G)
924 Enable WAN-wide browse list collation. Local master browsers on
925 broadcast-isolated subnets will give samba their local browse lists, and
926 ask for a complete copy of the browse list for the whole wide area network.
927 Browser clients will then contact their local master browser, and will
928 receive the domain-wide browse list, instead of just the list for their
929 broadcast-isolated subnet.
935 There are certain directories on some systems (eg., the /proc tree under
936 Linux) that are either not of interest to clients or are infinitely deep
937 (recursive). This parameter allows you to specify a comma-delimited list
938 of directories that the server should always show as empty.
940 Note that Samba can be very fussy about the exact format of the "dont
941 descend" entries. For example you may need "./proc" instead of just
942 "/proc". Experimentation is the best policy :-)
945 none (i.e., all directories are OK to descend)
948 dont descend = /proc,/dev
950 .SS encrypt passwords (G)
952 This boolean controls whether encrypted passwords will be negotiated
953 with the client. Note that this option has no effect if you haven't
954 compiled in the necessary des libraries and encryption code. It
959 This is an alias for preexec
963 This specifies a group name that all connections to this service
964 should be made as. This may be useful for sharing files.
973 This specifies a user name that all connections to this service
974 should be made as. This may be useful for sharing files. You should
975 also use it carefully as using it incorrectly can cause security
978 This user name only gets used once a connection is established. Thus
979 clients still need to connect as a valid user and supply a valid
980 password. Once connected, all file operations will be performed as the
981 "forced user", not matter what username the client connected as.
989 .SS guest account (S)
990 This is a username which will be used for access to services which are
991 specified as 'guest ok' (see below). Whatever privileges this user has
992 will be available to any client connecting to the guest
993 service. Typically this user will exist in the password file, but will
994 not have a valid login. If a username is specified in a given service,
995 the specified username overrides this one.
997 One some systems the account "nobody" may not be able to print. Use
998 another account in this case. You should test this by trying to log in
999 as your guest user (perhaps by using the "su \-" command) and trying to
1003 Note that as of version 1.9 of Samba this option may be set
1004 differently for each service.
1007 specified at compile time
1010 guest account = nobody
1012 This is a tuning option. When this is enabled a cacheing algorithm will
1013 be used to reduce the time taken for getwd() calls. This can have a
1014 significant impact on performance, especially when widelinks is False.
1025 If this parameter is 'yes' for a service, then only guest connections to the
1026 service are permitted. This parameter will have no affect if "guest ok" or
1027 "public" is not set for the service.
1029 See the section below on user/password validation for more information about
1037 .SS hide dot files (S)
1038 This is a boolean parameter that controls whether files starting with
1039 a dot appear as hidden files.
1042 hide dot files = yes
1054 This is an alias for "force group" and is only kept for compatibility
1055 with old versions of Samba. It may be removed in future versions.
1058 If this global parameter is a non-null string, it specifies the name of
1059 a file to read for the names of hosts and users who will be allowed access
1060 without specifying a password.
1062 This is not be confused with
1064 which is about hosts access to services and is more useful for guest services.
1066 may be useful for NT clients which will not supply passwords to samba.
1068 NOTE: The use of hosts.equiv can be a major security hole. This is
1069 because you are trusting the PC to supply the correct username. It is
1070 very easy to get a PC to supply a false username. I recommend that the
1071 hosts.equiv option be only used if you really know what you are doing,
1072 or perhaps on a home network where you trust your wife and kids :-)
1075 No host equivalences
1078 hosts equiv = /etc/hosts.equiv
1082 This option allows you to setup multiple network interfaces, so that
1083 Samba can properly handle browsing on all interfaces.
1085 The option takes a list of ip/netmask pairs. The netmask may either be
1086 a bitmask, or a bitlength.
1088 For example, the following line:
1090 interfaces = 192.168.2.10/24 192.168.3.10/24
1092 would configure two network interfaces with IP addresses 192.168.2.10
1093 and 192.168.3.10. The netmasks of both interfaces would be set to
1096 You could produce an equivalent result by using:
1098 interfaces = 192.168.2.10/255.255.255.0 192.168.3.10/255.255.255.0
1100 if you prefer that format.
1102 If this option is not set then Samba will attempt to find a primary
1103 interface, but won't attempt to configure more than one interface.
1105 .SS invalid users (S)
1106 This is a list of users that should not be allowed to login to this
1107 service. This is really a "paranoid" check to absolutely ensure an
1108 improper setting does not breach your security.
1110 A name starting with @ is interpreted as a UNIX group.
1112 The current servicename is substituted for %S. This is useful in the
1115 See also "valid users"
1121 invalid users = root fred admin @wheel
1125 This allows you to include one config file inside another. The file is
1126 included literally, as though typed in place.
1128 It takes the standard substitutions, except %u, %P and %S
1131 The value of the parameter (an integer) represents the number of seconds
1132 between 'keepalive' packets. If this parameter is zero, no keepalive packets
1133 will be sent. Keepalive packets, if sent, allow the server to tell whether a
1134 client is still present and responding.
1136 Keepalives should, in general, not be needed if the socket being used
1137 has the SO_KEEPALIVE attribute set on it (see "socket
1138 options"). Basically you should only use this option if you strike
1146 .SS load printers (G)
1147 A boolean variable that controls whether all printers in the printcap
1148 will be loaded for browsing by default.
1156 .SS lock directory (G)
1157 This options specifies the directory where lock files will be placed.
1158 The lock files are used to implement the "max connections" option.
1161 lock directory = /tmp/samba
1164 lock directory = /usr/local/samba/var/locks
1166 This controls whether or not locking will be performed by the server in
1167 response to lock requests from the client.
1169 If "locking = no", all lock and unlock requests will appear to succeed and
1170 all lock queries will indicate that the queried lock is clear.
1172 If "locking = yes", real locking will be performed by the server.
1174 This option may be particularly useful for read-only filesystems which
1175 do not need locking (such as cdrom drives).
1177 Be careful about disabling locking either globally or in a specific
1178 service, as lack of locking may result in data corruption.
1188 This options allows you to override the name of the Samba log file
1189 (also known as the debug file).
1191 This option takes the standard substitutions, allowing you to have
1192 separate log files for each user or machine.
1195 log file = /usr/local/samba/var/log.%m
1200 .SS lppause command (S)
1201 This parameter specifies the command to be executed on the server host in
1202 order to stop printing or spooling a specific print job.
1204 This command should be a program or script which takes a printer name and
1205 job number to pause the print job. Currently I don't know of any print
1206 spooler system that can do this with a simple option, except for the PPR
1207 system from Trinity College (ppr\-dist.trincoll.edu/pub/ppr). One way
1208 of implementing this is by using job priorities, where jobs having a too
1209 low priority won't be sent to the printer. See also the
1213 If a %p is given then the printername is put in its place. A %j is
1214 replaced with the job number (an integer).
1215 On HPUX (see printing=hpux), if the -p%p option is added to the lpq
1216 command, the job will show up with the correct status, i.e. if the job
1217 priority is lower than the set fence priority it will have the PAUSED
1218 status, whereas if the priority is equal or higher it will have the
1219 SPOOLED or PRINTING status.
1221 Note that it is good practice to include the absolute path in the lppause
1222 command as the PATH may not be available to the server.
1225 Currently no default value is given to this string
1227 .B Example for HPUX:
1228 lppause command = /usr/bin/lpalt %p-%j -p0
1230 .SS lpq cache time (G)
1232 This controls how long lpq info will be cached for to prevent the lpq
1233 command being called too often. A separate cache is kept for each
1234 variation of the lpq command used by the system, so if you use
1235 different lpq commands for different users then they won't share cache
1238 The cache files are stored in /tmp/lpq.xxxx where xxxx is a hash
1239 of the lpq command in use.
1241 The default is 10 seconds, meaning that the cached results of a
1242 previous identical lpq command will be used if the cached data is less
1243 than 10 seconds old. A large value may be advisable if your lpq
1244 command is very slow.
1246 A value of 0 will disable cacheing completely.
1255 This parameter specifies the command to be executed on the server host in
1256 order to obtain "lpq"-style printer status information.
1258 This command should be a program or script which takes a printer name
1259 as its only parameter and outputs printer status information.
1261 Currently six styles of printer status information are supported; BSD,
1262 SYSV, AIX, HPUX, QNX, LPRNG and PLP. This covers most UNIX systems. You
1263 control which type is expected using the "printing =" option.
1265 Some clients (notably Windows for Workgroups) may not correctly send the
1266 connection number for the printer they are requesting status information
1267 about. To get around this, the server reports on the first printer service
1268 connected to by the client. This only happens if the connection number sent
1271 If a %p is given then the printername is put in its place. Otherwise
1272 it is placed at the end of the command.
1274 Note that it is good practice to include the absolute path in the lpq
1275 command as the PATH may not be available to the server.
1278 depends on the setting of "printing ="
1281 lpq command = /usr/bin/lpq %p
1283 .SS lpresume command (S)
1284 This parameter specifies the command to be executed on the server host in
1285 order to restart or continue printing or spooling a specific print job.
1287 This command should be a program or script which takes a printer name and
1288 job number to resume the print job. See also the lppause command.
1290 If a %p is given then the printername is put in its place. A %j is
1291 replaced with the job number (an integer).
1293 Note that it is good practice to include the absolute path in the lpresume
1294 command as the PATH may not be available to the server.
1297 Currently no default value is given to this string
1299 .B Example for HPUX:
1300 lpresume command = /usr/bin/lpalt %p-%j -p2
1302 .SS lprm command (S)
1303 This parameter specifies the command to be executed on the server host in
1304 order to delete a print job.
1306 This command should be a program or script which takes a printer name
1307 and job number, and deletes the print job.
1309 Currently seven styles of printer control are supported; BSD, SYSV, AIX
1310 HPUX, QNX, LPRNG and PLP. This covers most UNIX systems. You control
1311 which type is expected using the "printing =" option.
1313 If a %p is given then the printername is put in its place. A %j is
1314 replaced with the job number (an integer).
1316 Note that it is good practice to include the absolute path in the lprm
1317 command as the PATH may not be available to the server.
1320 depends on the setting of "printing ="
1323 lprm command = /usr/bin/lprm -P%p %j
1326 lprm command = /usr/bin/cancel %p-%j
1328 .SS magic output (S)
1329 This parameter specifies the name of a file which will contain output
1330 created by a magic script (see
1334 Warning: If two clients use the same magic script in the same directory the
1335 output file content is undefined.
1337 magic output = <magic script name>.out
1340 magic output = myfile.txt
1341 .SS magic script (S)
1342 This parameter specifies the name of a file which, if opened, will be
1343 executed by the server when the file is closed. This allows a UNIX script
1344 to be sent to the Samba host and executed on behalf of the connected user.
1346 Scripts executed in this way will be deleted upon completion, permissions
1349 If the script generates output, output will be sent to the file specified by
1352 parameter (see above).
1354 Note that some shells are unable to interpret scripts containing
1355 carriage-return-linefeed instead of linefeed as the end-of-line
1356 marker. Magic scripts must be executable "as is" on the host, which
1357 for some hosts and some shells will require filtering at the DOS end.
1359 Magic scripts are EXPERIMENTAL and should NOT be relied upon.
1362 None. Magic scripts disabled.
1365 magic script = user.csh
1367 This is for those who want to directly map UNIX file names which are
1368 not representable on DOS. The mangling of names is not always what is
1369 needed. In particular you may have documents with file extensions
1370 that differ between DOS and UNIX. For example, under UNIX it is common
1371 to use .html for HTML files, whereas under DOS .htm is more commonly
1374 So to map 'html' to 'htm' you put:
1376 mangled map = (*.html *.htm)
1378 One very useful case is to remove the annoying ;1 off the ends of
1379 filenames on some CDROMS (only visible under some UNIXes). To do this
1380 use a map of (*;1 *)
1386 mangled map = (*;1 *)
1390 See the section on "NAME MANGLING"
1392 .SS mangled names (S)
1393 This controls whether non-DOS names under UNIX should be mapped to
1394 DOS-compatible names ("mangled") and made visible, or whether non-DOS names
1395 should simply be ignored.
1397 See the section on "NAME MANGLING" for details on how to control the
1400 If mangling is used then the mangling algorithm is as follows:
1402 - the first (up to) five alphanumeric characters before the rightmost dot of
1403 the filename are preserved, forced to upper case, and appear as the first (up
1404 to) five characters of the mangled name.
1406 - a tilde ("~") is appended to the first part of the mangled name, followed
1407 by a two-character unique sequence, based on the original root name
1408 (i.e., the original filename minus its final extension). The final
1409 extension is included in the hash calculation only if it contains any upper
1410 case characters or is longer than three characters.
1412 Note that the character to use may be specified using the "mangling
1413 char" option, if you don't like ~.
1415 - the first three alphanumeric characters of the final extension are preserved,
1416 forced to upper case and appear as the extension of the mangled name. The
1417 final extension is defined as that part of the original filename after the
1418 rightmost dot. If there are no dots in the filename, the mangled name will
1419 have no extension (except in the case of hidden files - see below).
1421 - files whose UNIX name begins with a dot will be presented as DOS hidden
1422 files. The mangled name will be created as for other filenames, but with the
1423 leading dot removed and "___" as its extension regardless of actual original
1424 extension (that's three underscores).
1427 The two-digit hash value consists of upper case alphanumeric characters.
1429 This algorithm can cause name collisions only if files in a directory share
1430 the same first five alphanumeric characters. The probability of such a clash
1433 The name mangling (if enabled) allows a file to be copied between UNIX
1434 directories from DOS while retaining the long UNIX filename. UNIX files can
1435 be renamed to a new extension from DOS and will retain the same basename.
1436 Mangled names do not change between sessions.
1443 .SS mangling char (S)
1444 This controls what character is used as the "magic" character in name
1445 mangling. The default is a ~ but this may interfere with some
1446 software. Use this option to set it to whatever you prefer.
1454 .SS max disk size (G)
1455 This option allows you to put an upper limit on the apparent size of
1456 disks. If you set this option to 100 then all shares will appear to be
1457 not larger than 100 MB in size.
1459 Note that this option does not limit the amount of data you can put on
1460 the disk. In the above case you could still store much more than 100
1461 MB on the disk, but if a client ever asks for the amount of free disk
1462 space or the total disk size then the result will be bounded by the
1463 amount specified in "max disk size".
1465 This option is primarily useful to work around bugs in some pieces of
1466 software that can't handle very large disks, particularly disks over
1469 A "max disk size" of 0 means no limit.
1475 max disk size = 1000
1476 .SS max log size (G)
1478 This option (an integer in kilobytes) specifies the max size the log
1479 file should grow to. Samba periodically checks the size and if it is
1480 exceeded it will rename the file, adding a .old extension.
1482 A size of 0 means no limit.
1492 This option controls the maximum packet size that will be negotiated
1493 by Samba. The default is 65535, which is the maximum. In some cases
1494 you may find you get better performance with a smaller value. A value
1495 below 2048 is likely to cause problems.
1503 .SS mangled stack (G)
1504 This parameter controls the number of mangled names that should be cached in
1507 This stack is a list of recently mangled base names (extensions are only
1508 maintained if they are longer than 3 characters or contains upper case
1511 The larger this value, the more likely it is that mangled names can be
1512 successfully converted to correct long UNIX names. However, large stack
1513 sizes will slow most directory access. Smaller stacks save memory in the
1514 server (each stack element costs 256 bytes).
1516 It is not possible to absolutely guarantee correct long file names, so
1517 be prepared for some surprises!
1526 This controls whether the DOS archive attribute should be mapped to UNIX
1527 execute bits. The DOS archive bit is set when a file has been modified
1528 since its last backup. One motivation for this option it to keep Samba/your
1529 PC from making any file it touches from becoming executable under UNIX.
1530 This can be quite annoying for shared source code, documents, etc...
1539 This controls whether DOS style hidden files should be mapped to UNIX
1548 This controls whether DOS style system files should be mapped to UNIX
1556 .SS max connections (S)
1557 This option allows the number of simultaneous connections to a
1558 service to be limited. If "max connections" is greater than 0 then
1559 connections will be refused if this number of connections to the
1560 service are already open. A value of zero mean an unlimited number of
1561 connections may be made.
1563 Record lock files are used to implement this feature. The lock files
1564 will be stored in the directory specified by the "lock directory" option.
1570 max connections = 10
1572 This is a boolean option that controls whether connections with
1573 usernames not in the user= list will be allowed. By default this
1574 option is disabled so a client can supply a username to be used by
1577 Note that this also means Samba won't try to deduce usernames from the
1578 service name. This can be annoying for the [homes] section. To get
1579 around this you could use "user = %S" which means your "user" list
1580 will be just the service name, which for home directories is the name
1589 .SS fake oplocks (S)
1591 Oplocks are the way that SMB clients get permission from a server to
1592 locally cache file operations. If a server grants an oplock
1593 (opportunistic lock) then the client is free to assume that it is the
1594 only one accessing the file and it will aggressively cache file
1595 data. With some oplock types the client may even cache file open/close
1596 operations. This can give enormous performance benefits.
1598 Samba does not support opportunistic locks because they are very
1599 difficult to do under Unix. Samba can fake them, however, by granting
1600 a oplock whenever a client asks for one. This is controlled using the
1601 smb.conf option "fake oplocks". If you set "fake oplocks = yes" then
1602 you are telling the client that it may aggressively cache the file
1605 By enabling this option on all read-only shares or shares that you know
1606 will only be accessed from one client at a time you will see a big
1607 performance improvement on many operations. If you enable this option
1608 on shares where multiple clients may be accessing the files read-write
1609 at the same time you can get data corruption. Use this option
1612 This option is disabled by default.
1614 .SS message command (G)
1616 This specifies what command to run when the server receives a WinPopup
1619 This would normally be a command that would deliver the message
1620 somehow. How this is to be done is up to your imagination.
1624 message command = csh -c 'xedit %s;rm %s' &
1626 This delivers the message using xedit, then removes it
1627 afterwards. NOTE THAT IT IS VERY IMPORTANT THAT THIS COMMAND RETURN
1628 IMMEDIATELY. That's why I have the & on the end. If it doesn't return
1629 immediately then your PCs may freeze when sending messages (they
1630 should recover after 30secs, hopefully).
1632 All messages are delivered as the global guest user. The command takes
1633 the standard substitutions, although %u won't work (%U may be better
1636 Apart from the standard substitutions, some additional ones apply. In
1639 %s = the filename containing the message
1641 %t = the destination that the message was sent to (probably the server
1644 %f = who the message is from
1646 You could make this command send mail, or whatever else takes your
1647 fancy. Please let me know of any really interesting ideas you have.
1649 Here's a way of sending the messages as mail to root:
1651 message command = /bin/mail -s 'message from %f on %m' root < %s; rm %s
1653 If you don't have a message command then the message won't be
1654 delivered and Samba will tell the sender there was an
1655 error. Unfortunately WfWg totally ignores the error code and carries
1656 on regardless, saying that the message was delivered.
1658 If you want to silently delete it then try "message command = rm %s".
1660 For the really adventurous, try something like this:
1662 message command = csh -c 'csh < %s |& /usr/local/samba/bin/smbclient \e
1665 this would execute the command as a script on the server, then give
1666 them the result in a WinPopup message. Note that this could cause a
1667 loop if you send a message from the server using smbclient! You better
1668 wrap the above in a script that checks for this :-)
1674 message command = csh -c 'xedit %s;rm %s' &
1676 .SS min print space (S)
1678 This sets the minimum amount of free disk space that must be available
1679 before a user will be able to spool a print job. It is specified in
1680 kilobytes. The default is 0, which means no limit.
1686 min print space = 2000
1688 .SS null passwords (G)
1689 Allow or disallow access to accounts that have null passwords.
1695 null passwords = yes
1698 This integer value controls what level Samba advertises itself as for
1699 browse elections. See BROWSING.txt for details.
1702 The maximum transmit packet size during a raw read. This option is no
1703 longer implemented as of version 1.7.00, and is kept only so old
1704 configuration files do not become invalid.
1707 This string controls the "chat" conversation that takes places
1708 between smbd and the local password changing program to change the
1709 users password. The string describes a sequence of response-receive
1710 pairs that smbd uses to determine what to send to the passwd program
1711 and what to expect back. If the expected output is not received then
1712 the password is not changed.
1714 This chat sequence is often quite site specific, depending on what
1715 local methods are used for password control (such as NIS+ etc).
1717 The string can contain the macros %o and %n which are substituted for
1718 the old and new passwords respectively. It can also contain the
1719 standard macros \en \er \et and \es to give line-feed, carriage-return,
1722 The string can also contain a * which matches any sequence of
1725 Double quotes can be used to collect strings with spaces in them into
1728 If the send string in any part of the chat sequence is a fullstop "."
1729 then no string is sent. Similarly, is the expect string is a fullstop
1730 then no string is expected.
1733 passwd chat = "*Enter OLD password*" %o\en "*Enter NEW password*" %n\en \e
1734 "*Reenter NEW password*" %n\en "*Password changed*"
1738 passwd chat = *old*password* %o\en *new*password* %n\en *new*password* %n\en *changed*
1740 .SS passwd program (G)
1741 The name of a program that can be used to set user passwords.
1743 This is only necessary if you have enabled remote password changing at
1744 compile time. Any occurrences of %u will be replaced with the user
1747 Also note that many passwd programs insist in "reasonable" passwords,
1748 such as a minimum length, or the inclusion of mixed case chars and
1749 digits. This can pose a problem as some clients (such as Windows for
1750 Workgroups) uppercase the password before sending it.
1753 passwd program = /bin/passwd
1756 passwd program = /sbin/passwd %u
1758 .SS password level (G)
1759 Some client/server combinations have difficulty with mixed-case passwords.
1760 One offending client is Windows for Workgroups, which for some reason forces
1761 passwords to upper case when using the LANMAN1 protocol, but leaves them alone
1762 when using COREPLUS!
1764 This parameter defines the maximum number of characters that may be upper case
1767 For example, say the password given was "FRED". If
1769 is set to 1 (one), the following combinations would be tried if "FRED" failed:
1770 "Fred", "fred", "fRed", "frEd", "freD". If
1771 .B password level was set to 2 (two), the following combinations would also be
1772 tried: "FRed", "FrEd", "FreD", "fREd", "fReD", "frED". And so on.
1774 The higher value this parameter is set to the more likely it is that a mixed
1775 case password will be matched against a single case password. However, you
1776 should be aware that use of this parameter reduces security and increases the
1777 time taken to process a new connection.
1779 A value of zero will cause only two attempts to be made - the password as is
1780 and the password in all-lower case.
1782 If you find the connections are taking too long with this option then
1783 you probably have a slow crypt() routine. Samba now comes with a fast
1784 "ufc crypt" that you can select in the Makefile. You should also make
1785 sure the PASSWORD_LENGTH option is correct for your system in local.h
1786 and includes.h. On most systems only the first 8 chars of a password
1787 are significant so PASSWORD_LENGTH should be 8, but on some longer
1788 passwords are significant. The includes.h file tries to select the
1789 right length for your system.
1797 .SS password server (G)
1799 By specifying the name of another SMB server (such as a WinNT box)
1800 with this option, and using "security = server" you can get Samba to
1801 do all its username/password validation via a remote server.
1803 This options sets the name of the password server to use. It must be a
1804 netbios name, so if the machine's netbios name is different from its
1805 internet name then you may have to add its netbios name to
1808 The password server much be a machine capable of using the "LM1.2X002"
1809 or the "LM NT 0.12" protocol, and it must be in user level security
1812 NOTE: Using a password server means your UNIX box (running Samba) is
1813 only as secure as your password server. DO NOT CHOOSE A PASSWORD
1814 SERVER THAT YOU DON'T COMPLETELY TRUST.
1816 Never point a Samba server at itself for password serving. This will
1817 cause a loop and could lock up your Samba server!
1819 The name of the password server takes the standard substitutions, but
1820 probably the only useful one is %m, which means the Samba server will
1821 use the incoming client as the password server. If you use this then
1822 you better trust your clients, and you better restrict them with hosts
1825 If you list several hosts in the "password server" option then smbd
1826 will try each in turn till it finds one that responds. This is useful
1827 in case your primary server goes down.
1830 A synonym for this parameter is 'directory'.
1832 This parameter specifies a directory to which the user of the service is to
1833 be given access. In the case of printable services, this is where print data
1834 will spool prior to being submitted to the host for printing.
1836 For a printable service offering guest access, the service should be readonly
1837 and the path should be world-writable and have the sticky bit set. This is not
1838 mandatory of course, but you probably won't get the results you expect if you
1841 Any occurrences of %u in the path will be replaced with the username
1842 that the client is connecting as. Any occurrences of %m will be
1843 replaced by the name of the machine they are connecting from. These
1844 replacements are very useful for setting up pseudo home directories
1847 Note that this path will be based on 'root dir' if one was specified.
1856 This option specifies a command to be run whenever the service is
1857 disconnected. It takes the usual substitutions. The command may be run
1858 as the root on some systems.
1860 An interesting example may be do unmount server resources:
1862 postexec = /etc/umount /cdrom
1867 none (no command executed)
1870 postexec = echo \e"%u disconnected from %S from %m (%I)\e" >> /tmp/log
1873 This parameter forces a printer to interpret the print files as
1874 postscript. This is done by adding a %! to the start of print output.
1876 This is most useful when you have lots of PCs that persist in putting
1877 a control-D at the start of print jobs, which then confuses your
1888 This option specifies a command to be run whenever the service is
1889 connected to. It takes the usual substitutions.
1891 An interesting example is to send the users a welcome message every
1892 time they log in. Maybe a message of the day? Here is an example:
1894 preexec = csh -c 'echo \e"Welcome to %S!\e" | \e
1895 /usr/local/samba/bin/smbclient -M %m -I %I' &
1897 Of course, this could get annoying after a while :-)
1902 none (no command executed)
1905 preexec = echo \e"%u connected to %S from %m (%I)\e" >> /tmp/log
1907 .SS preferred master (G)
1908 This boolean parameter controls if Samba is a preferred master browser
1910 On startup, samba will force an election, and it will have a slight
1911 advantage in winning the election. It is recommended that this
1912 parameter is used in conjunction with domain master = yes, so that samba
1913 can guarantee becoming a domain master.
1919 preferred master = yes
1922 This is an alias for "auto services"
1924 .SS preserve case (S)
1926 This controls if new filenames are created with the case that the
1927 client passes, or if they are forced to be the "default" case.
1932 See the section on "NAME MANGLING" for a fuller discussion.
1934 .SS print command (S)
1935 After a print job has finished spooling to a service, this command will be
1936 used via a system() call to process the spool file. Typically the command
1937 specified will submit the spool file to the host's printing subsystem, but
1938 there is no requirement that this be the case. The server will not remove the
1939 spool file, so whatever command you specify should remove the spool file when
1940 it has been processed, otherwise you will need to manually remove old spool
1943 The print command is simply a text string. It will be used verbatim,
1944 with two exceptions: All occurrences of "%s" will be replaced by the
1945 appropriate spool file name, and all occurrences of "%p" will be
1946 replaced by the appropriate printer name. The spool file name is
1947 generated automatically by the server, the printer name is discussed
1950 The full path name will be used for the filename if %s is not preceded
1951 by a /. If you don't like this (it can stuff up some lpq output) then
1952 use %f instead. Any occurrences of %f get replaced by the spool
1953 filename without the full path at the front.
1955 The print command MUST contain at least one occurrence of "%s" or %f -
1956 the "%p" is optional. At the time a job is submitted, if no printer
1957 name is supplied the "%p" will be silently removed from the printer
1960 If specified in the [global] section, the print command given will be used
1961 for any printable service that does not have its own print command specified.
1963 If there is neither a specified print command for a printable service nor a
1964 global print command, spool files will be created but not processed and (most
1965 importantly) not removed.
1967 Note that printing may fail on some UNIXes from the "nobody"
1968 account. If this happens then create an alternative guest account that
1969 can print and set the "guest account" in the [global] section.
1971 You can form quite complex print commands by realising that they are
1972 just passed to a shell. For example the following will log a print
1973 job, print the file, then remove it. Note that ; is the usual
1974 separator for command in shell scripts.
1976 print command = echo Printing %s >> /tmp/print.log; lpr -P %p %s; rm %s
1978 You may have to vary this command considerably depending on how you
1979 normally print files on your system.
1982 print command = lpr -r -P %p %s
1985 print command = /usr/local/samba/bin/myprintscript %p %s
1990 A synonym for this parameter is 'print ok'.
1992 If this parameter is 'yes', then clients may open, write to and submit spool
1993 files on the directory specified for the service.
1995 Note that a printable service will ALWAYS allow writing to the service path
1996 (user privileges permitting) via the spooling of print data. The 'read only'
1997 parameter controls only non-printing access to the resource.
2006 This parameters controls how printer status information is interpreted
2007 on your system, and also affects the default values for the "print
2008 command", "lpq command" and "lprm command".
2010 Currently six printing styles are supported. They are "printing =
2011 bsd", "printing = sysv", "printing = hpux", "printing = aix",
2012 "printing = qnx" and "printing = plp".
2014 To see what the defaults are for the other print commands when using
2015 these three options use the "testparm" program.
2018 .SS printcap name (G)
2019 This parameter may be used to override the compiled-in default printcap
2020 name used by the server (usually /etc/printcap). See the discussion of the
2021 [printers] section above for reasons why you might want to do this.
2023 For those of you without a printcap (say on SysV) you can just create a
2024 minimal file that looks like a printcap and set "printcap name =" in
2025 [global] to point at it.
2027 A minimal printcap file would look something like this:
2039 where the | separates aliases of a printer. The fact that the second
2040 alias has a space in it gives a hint to Samba that it's a comment.
2042 NOTE: Under AIX the default printcap name is "/etc/qconfig". Samba
2043 will assume the file is in AIX "qconfig" format if the string
2044 "/qconfig" appears in the printcap filename.
2047 printcap name = /etc/printcap
2050 printcap name = /etc/myprintcap
2052 A synonym for this parameter is 'printer name'.
2054 This parameter specifies the name of the printer to which print jobs spooled
2055 through a printable service will be sent.
2057 If specified in the [global] section, the printer name given will be used
2058 for any printable service that does not have its own printer name specified.
2061 none (but may be 'lp' on many systems)
2064 printer name = laserwriter
2066 .SS printer driver (S)
2067 This option allows you to control the string that clients receive when
2068 they ask the server for the printer driver associated with a
2069 printer. If you are using Windows95 or WindowsNT then you can use this
2070 to automate the setup of printers on your system.
2072 You need to set this parameter to the exact string (case sensitive)
2073 that describes the appropriate printer driver for your system.
2074 If you don't know the exact string to use then you should first try
2075 with no "printer driver" option set and the client will give you a
2076 list of printer drivers. The appropriate strings are shown in a
2077 scrollbox after you have chosen the printer manufacturer.
2080 printer driver = HP LaserJet 4L
2082 .SS printer name (S)
2087 The value of the parameter (a string) is the highest protocol level that will
2088 be supported by the server.
2090 Possible values are CORE, COREPLUS, LANMAN1, LANMAN2 and NT1. The relative
2091 merits of each are discussed in the README file.
2093 Normally this option should not be set as the automatic negotiation
2094 phase in the SMB protocol takes care of choosing the appropriate protocol.
2102 A synonym for this parameter is 'guest ok'.
2104 If this parameter is 'yes' for a service, then no password is required
2105 to connect to the service. Privileges will be those of the guest
2108 See the section below on user/password validation for more information about
2117 This is a list of users that are given read-only access to a
2118 service. If the connecting user is in this list then they will
2119 not be given write access, no matter what the "read only" option
2120 is set to. The list can include group names using the @group syntax.
2122 See also the "write list" option
2128 read list = mary, @students
2135 Note that this is an inverted synonym for writable and write ok.
2136 .SS read prediction (G)
2137 This options enables or disables the read prediction code used to
2138 speed up reads from the server. When enabled the server will try to
2139 pre-read data from the last accessed file that was opened read-only
2140 while waiting for packets.
2143 read prediction = False
2146 read prediction = True
2148 This parameter controls whether or not the server will support raw reads when
2149 transferring data to clients.
2151 If enabled, raw reads allow reads of 65535 bytes in one packet. This
2152 typically provides a major performance benefit.
2154 However, some clients either negotiate the allowable block size incorrectly
2155 or are incapable of supporting larger block sizes, and for these clients you
2156 may need to disable raw reads.
2158 In general this parameter should be viewed as a system tuning tool and left
2159 severely alone. See also
2169 The option "read size" affects the overlap of disk reads/writes with
2170 network reads/writes. If the amount of data being transferred in
2171 several of the SMB commands (currently SMBwrite, SMBwriteX and
2172 SMBreadbraw) is larger than this value then the server begins writing
2173 the data before it has received the whole packet from the network, or
2174 in the case of SMBreadbraw, it begins writing to the network before
2175 all the data has been read from disk.
2177 This overlapping works best when the speeds of disk and network access
2178 are similar, having very little effect when the speed of one is much
2179 greater than the other.
2181 The default value is 2048, but very little experimentation has been
2182 done yet to determine the optimal value, and it is likely that the best
2183 value will vary greatly between systems anyway. A value over 65536 is
2184 pointless and will cause you to allocate memory unnecessarily.
2192 .SS remote announce (G)
2194 This option allows you to setup nmbd to periodically announce itself
2195 to arbitrary IP addresses with an arbitrary workgroup name.
2197 This is useful if you want your Samba server to appear in a remote
2198 workgroup for which the normal browse propagation rules don't
2199 work. The remote workgroup can be anywhere that you can send IP
2204 remote announce = 192.168.2.255/SERVERS 192.168.4.255/STAFF
2206 the above line would cause nmbd to announce itself to the two given IP
2207 addresses using the given workgroup names. If you leave out the
2208 workgroup name then the one given in the "workgroup" option is used
2211 The IP addresses you choose would normally be the broadcast addresses
2212 of the remote networks, but can also be the IP addresses of known
2213 browse masters if your network config is that stable.
2215 This option replaces similar functionality from the nmbd lmhosts file.
2219 This options controls whether Samba will allow a previously validated
2220 username/password pair to be used to attach to a share. Thus if you
2221 connect to \e\eserver\eshare1 then to \e\eserver\eshare2 it won't
2222 automatically allow the client to request connection to the second
2223 share as the same username as the first without a password.
2225 If "revalidate" is True then the client will be denied automatic
2226 access as the same username.
2240 .SS root directory (G)
2241 Synonyms for this parameter are 'root dir' and 'root'.
2243 The server will chroot() to this directory on startup. This is not
2244 strictly necessary for secure operation. Even without it the server
2245 will deny access to files not in one of the service entries. It may
2246 also check for, and deny access to, soft links to other parts of the
2247 filesystem, or attempts to use .. in file names to access other
2248 directories (depending on the setting of the "wide links" parameter).
2250 Adding a "root dir" entry other than "/" adds an extra level of security,
2251 but at a price. It absolutely ensures that no access is given to files not
2252 in the sub-tree specified in the "root dir" option, *including* some files
2253 needed for complete operation of the server. To maintain full operability
2254 of the server you will need to mirror some system files into the "root dir"
2255 tree. In particular you will need to mirror /etc/passwd (or a subset of it),
2256 and any binaries or configuration files needed for printing (if required).
2257 The set of files that must be mirrored is operating system dependent.
2263 root directory = /homes/smb
2265 This option affects how clients respond to Samba.
2267 The option sets the "security mode bit" in replies to protocol negotiations
2268 to turn share level security on or off. Clients decide based on this bit
2269 whether (and how) to transfer user and password information to the server.
2271 The default is "security=SHARE", mainly because that was the only
2272 option at one stage.
2274 The alternatives are "security = user" or "security = server".
2276 If your PCs use usernames that are the same as their usernames on the
2277 UNIX machine then you will want to use "security = user". If you
2278 mostly use usernames that don't exist on the UNIX box then use
2281 There is a bug in WfWg that may affect your decision. When in user
2282 level security a WfWg client will totally ignore the password you type
2283 in the "connect drive" dialog box. This makes it very difficult (if
2284 not impossible) to connect to a Samba service as anyone except the
2285 user that you are logged into WfWg as.
2287 If you use "security = server" then Samba will try to validate the
2288 username/password by passing it to another SMB server, such as an NT
2289 box. If this fails it will revert to "security = USER".
2291 See the "password server" option for more details.
2298 .SS server string (G)
2299 This controls what string will show up in the printer comment box in
2300 print manager and next to the IPC connection in "net view". It can be
2301 any string that you wish to show to your users.
2303 It also sets what will appear in browse lists next to the machine name.
2305 A %v will be replaced with the Samba version number.
2307 A %h will be replaced with the hostname.
2310 server string = Samba %v
2313 server string = University of GNUs Samba Server
2316 This sets the full path to the smbrun binary. This defaults to the
2317 value in the Makefile.
2319 You must get this path right for many services to work correctly.
2325 smbrun = /usr/local/samba/bin/smbrun
2327 .SS short preserve case (S)
2329 This controls if new short filenames are created with the case that
2330 the client passes, or if they are forced to be the "default" case.
2333 short preserve case = no
2335 See the section on "NAME MANGLING" for a fuller discussion.
2337 .SS root preexec (S)
2339 This is the same as preexec except that the command is run as
2340 root. This is useful for mounting filesystems (such as cdroms) before
2341 a connection is finalised.
2343 .SS root postexec (S)
2345 This is the same as postexec except that the command is run as
2346 root. This is useful for unmounting filesystems (such as cdroms) after
2347 a connection is closed.
2349 .SS set directory (S)
2350 If 'set directory = no', then users of the service may not use the setdir
2351 command to change directory.
2353 The setdir command is only implemented in the Digital Pathworks client. See the
2354 Pathworks documentation for details.
2364 This enables or disables the honouring of the "share modes" during a
2365 file open. These modes are used by clients to gain exclusive read or
2366 write access to a file.
2368 These open modes are not directly supported by UNIX, so they are
2369 simulated using lock files in the "lock directory". The "lock
2370 directory" specified in smb.conf must be readable by all users.
2372 The share modes that are enabled by this option are DENY_DOS,
2373 DENY_ALL, DENY_READ, DENY_WRITE, DENY_NONE and DENY_FCB.
2375 Enabling this option gives full share compatibility but may cost a bit
2376 of processing time on the UNIX server. They are enabled by default.
2384 .SS socket address (G)
2386 This option allows you to control what address Samba will listen for
2387 connections on. This is used to support multiple virtual interfaces on
2388 the one server, each with a different configuration.
2390 By default samba will accept connections on any address.
2393 socket address = 192.168.2.20
2395 .SS socket options (G)
2396 This option (which can also be invoked with the -O command line
2397 option) allows you to set socket options to be used when talking with
2400 Socket options are controls on the networking layer of the operating
2401 systems which allow the connection to be tuned.
2403 This option will typically be used to tune your Samba server for
2404 optimal performance for your local network. There is no way that Samba
2405 can know what the optimal parameters are for your net, so you must
2406 experiment and choose them yourself. I strongly suggest you read the
2407 appropriate documentation for your operating system first (perhaps
2408 "man setsockopt" will help).
2410 You may find that on some systems Samba will say "Unknown socket
2411 option" when you supply an option. This means you either mis-typed it
2412 or you need to add an include file to includes.h for your OS. If the
2413 latter is the case please send the patch to me
2414 (samba-bugs@samba.anu.edu.au).
2416 Any of the supported socket options may be combined in any way you
2417 like, as long as your OS allows it.
2419 This is the list of socket options currently settable using this
2442 Those marked with a * take an integer argument. The others can
2443 optionally take a 1 or 0 argument to enable or disable the option, by
2444 default they will be enabled if you don't specify 1 or 0.
2446 To specify an argument use the syntax SOME_OPTION=VALUE for example
2447 SO_SNDBUF=8192. Note that you must not have any spaces before or after
2450 If you are on a local network then a sensible option might be
2452 socket options = IPTOS_LOWDELAY
2454 If you have an almost unloaded local network and you don't mind a lot
2455 of extra CPU usage in the server then you could try
2457 socket options = IPTOS_LOWDELAY TCP_NODELAY
2459 If you are on a wide area network then perhaps try setting
2462 Note that several of the options may cause your Samba server to fail
2463 completely. Use these options with caution!
2469 socket options = IPTOS_LOWDELAY
2475 This enables or disables logging of connections to a status file that
2481 won't be able to tell you what
2482 connections are active.
2491 This is a boolean that controls whether to strip trailing dots off
2492 filenames. This helps with some CDROMs that have filenames ending in a
2495 NOTE: This option is now obsolete, and may be removed in future. You
2496 should use the "mangled map" option instead as it is much more
2499 .SS strict locking (S)
2500 This is a boolean that controls the handling of file locking in the
2501 server. When this is set to yes the server will check every read and
2502 write access for file locks, and deny access if locks exist. This can
2503 be slow on some systems.
2505 When strict locking is "no" the server does file lock checks only when
2506 the client explicitly asks for them.
2508 Well behaved clients always ask for lock checks when it is important,
2509 so in the vast majority of cases "strict locking = no" is preferable.
2515 strict locking = yes
2519 This is a boolean parameter that controls whether writes will always
2520 be written to stable storage before the write call returns. If this is
2521 false then the server will be guided by the client's request in each
2522 write call (clients can set a bit indicating that a particular write
2523 should be synchronous). If this is true then every write will be
2524 followed by a fsync() call to ensure the data is written to disk.
2533 This parameter is a setting in minutes to add to the normal GMT to
2534 local time conversion. This is useful if you are serving a lot of PCs
2535 that have incorrect daylight saving time handling.
2547 A synonym for this parameter is 'user'.
2549 Multiple users may be specified in a comma-delimited list, in which case the
2550 supplied password will be tested against each username in turn (left to right).
2552 The username= line is needed only when the PC is unable to supply its own
2553 username. This is the case for the coreplus protocol or where your
2554 users have different WfWg usernames to UNIX usernames. In both these
2555 cases you may also be better using the \e\eserver\eshare%user syntax
2558 The username= line is not a great solution in many cases as it means Samba
2559 will try to validate the supplied password against each of the
2560 usernames in the username= line in turn. This is slow and a bad idea for
2561 lots of users in case of duplicate passwords. You may get timeouts or
2562 security breaches using this parameter unwisely.
2564 Samba relies on the underlying UNIX security. This parameter does not
2565 restrict who can login, it just offers hints to the Samba server as to
2566 what usernames might correspond to the supplied password. Users can
2567 login as whoever they please and they will be able to do no more
2568 damage than if they started a telnet session. The daemon runs as the
2569 user that they log in as, so they cannot do anything that user cannot
2572 To restrict a service to a particular set of users you can use the
2573 "valid users=" line.
2575 If any of the usernames begin with a @ then the name will be looked up
2576 in the groups file and will expand to a list of all users in the group
2577 of that name. Note that searching though a groups file can take quite
2578 some time, and some clients may time out during the search.
2580 See the section below on username/password validation for more information
2581 on how this parameter determines access to the services.
2584 The guest account if a guest service, else the name of the service.
2588 username = fred, mary, jack, jane, @users, @pcgroup
2590 .SS username map (G)
2592 This option allows you to to specify a file containing a mapping of
2593 usernames from the clients to the server. This can be used for several
2594 purposes. The most common is to map usernames that users use on DOS or
2595 Windows machines to those that the UNIX box uses. The other is to map
2596 multiple users to a single username so that they can more easily share
2599 The map file is parsed line by line. Each line should contain a single
2600 UNIX username on the left then a '=' followed by a list of usernames
2601 on the right. The list of usernames on the right may contain names of
2602 the form @group in which case they will match any UNIX username in
2603 that group. The special client name '*' is a wildcard and matches any
2606 The file is processed on each line by taking the supplied username and
2607 comparing it with each username on the right hand side of the '='
2608 signs. If the supplied name matches any of the names on the right
2609 hand side then it is replaced with the name on the left. Processing
2610 then continues with the next line.
2612 If any line begins with a '#' or a ';' then it is ignored
2614 For example to map from the name "admin" or "administrator" to the UNIX
2615 name "root" you would use
2617 root = admin administrator
2619 Or to map anyone in the UNIX group "system" to the UNIX name "sys" you
2624 You can have as many mappings as you like in a username map file.
2626 Note that the remapping is applied to all occurrences of
2627 usernames. Thus if you connect to "\e\eserver\efred" and "fred" is
2628 remapped to "mary" then you will actually be connecting to
2629 "\e\eserver\emary" and will need to supply a password suitable for
2630 "mary" not "fred". The only exception to this is the username passed
2631 to the "password server" (if you have one). The password server will
2632 receive whatever username the client supplies without modification.
2634 Also note that no reverse mapping is done. The main effect this has is
2635 with printing. Users who have been mapped may have trouble deleting
2636 print jobs as PrintManager under WfWg will think they don't own the
2643 username map = /usr/local/samba/lib/users.map
2647 The option allows you to specify additional characters that should be
2648 considered valid by the server in filenames. This is particularly
2649 useful for national character sets, such as adding u-umlaut or a-ring.
2651 The option takes a list of characters in either integer or character
2652 form with spaces between them. If you give two characters with a colon
2653 between them then it will be taken as an lowercase:uppercase pair.
2655 If you have an editor capable of entering the characters into the
2656 config file then it is probably easiest to use this method. Otherwise
2657 you can specify the characters in octal, decimal or hexadecimal form
2658 using the usual C notation.
2660 For example to add the single character 'Z' to the charset (which is a
2661 pointless thing to do as it's already there) you could do one of the
2666 valid chars = 0132:0172
2668 The last two examples above actually add two characters, and alter
2669 the uppercase and lowercase mappings appropriately.
2673 Samba defaults to using a reasonable set of valid characters
2678 valid chars = 0345:0305 0366:0326 0344:0304
2680 The above example allows filenames to have the swedish characters in
2683 NOTE: It is actually quite difficult to correctly produce a "valid
2684 chars" line for a particular system. To automate the process
2685 tino@augsburg.net has written a package called "validchars" which will
2686 automatically produce a complete "valid chars" line for a given client
2687 system. Look in the examples subdirectory for this package.
2690 This is a list of users that should be allowed to login to this
2691 service. A name starting with @ is interpreted as a UNIX group.
2693 If this is empty (the default) then any user can login. If a username
2694 is in both this list and the "invalid users" list then access is
2695 denied for that user.
2697 The current servicename is substituted for %S. This is useful in the
2700 See also "invalid users"
2703 No valid users list. (anyone can login)
2706 valid users = greg, @pcusers
2709 This allows you to override the volume label returned for a
2710 share. Useful for CDROMs with installation programs that insist on a
2711 particular volume label.
2713 The default is the name of the share
2716 This parameter controls whether or not links in the UNIX file system may be
2717 followed by the server. Links that point to areas within the directory tree
2718 exported by the server are always allowed; this parameter controls access
2719 only to areas that are outside the directory tree being exported.
2729 This is a boolean that controls if nmbd will respond to broadcast name
2730 queries on behalf of other hosts. You may need to set this to no for
2735 .SS wins support (G)
2737 This boolean controls if Samba will act as a WINS server. You should
2738 normally set this to true unless you already have another WINS server
2745 This specifies the DNS name of the WINS server that Samba should
2746 register with. If you have a WINS server on your network then you
2747 should set this to the WINS servers name.
2749 This option only takes effect if Samba is not acting as a WINS server
2756 This controls what workgroup your server will appear to be in when
2771 A synonym for this parameter is 'write ok'. An inverted synonym is 'read only'.
2773 If this parameter is 'no', then users of a service may not create or modify
2774 files in the service's directory.
2776 Note that a printable service ('printable = yes') will ALWAYS allow
2777 writing to the directory (user privileges permitting), but only via
2778 spooling operations.
2788 This is a list of users that are given read-write access to a
2789 service. If the connecting user is in this list then they will be
2790 given write access, no matter what the "read only" option is set
2791 to. The list can include group names using the @group syntax.
2793 Note that if a user is in both the read list and the write list then
2794 they will be given write access.
2796 See also the "read list" option
2802 write list = admin, root, @staff
2805 This parameter controls whether or not the server will support raw writes when
2806 transferring data from clients.
2813 .SH NOTE ABOUT USERNAME/PASSWORD VALIDATION
2814 There are a number of ways in which a user can connect to a
2815 service. The server follows the following steps in determining if it
2816 will allow a connection to a specified service. If all the steps fail
2817 then the connection request is rejected. If one of the steps pass then
2818 the following steps are not checked.
2820 If the service is marked "guest only = yes" then steps 1 to 5 are skipped
2822 Step 1: If the client has passed a username/password pair and that
2823 username/password pair is validated by the UNIX system's password
2824 programs then the connection is made as that username. Note that this
2825 includes the \e\eserver\eservice%username method of passing a username.
2827 Step 2: If the client has previously registered a username with the
2828 system and now supplies a correct password for that username then the
2829 connection is allowed.
2831 Step 3: The client's netbios name and any previously used user names
2832 are checked against the supplied password, if they match then the
2833 connection is allowed as the corresponding user.
2835 Step 4: If the client has previously validated a username/password
2836 pair with the server and the client has passed the validation token
2837 then that username is used. This step is skipped if "revalidate = yes"
2840 Step 5: If a "user = " field is given in the smb.conf file for the
2841 service and the client has supplied a password, and that password
2842 matches (according to the UNIX system's password checking) with one of
2843 the usernames from the user= field then the connection is made as the
2844 username in the "user=" line. If one of the username in the user= list
2845 begins with a @ then that name expands to a list of names in the group
2848 Step 6: If the service is a guest service then a connection is made as
2849 the username given in the "guest account =" for the service,
2850 irrespective of the supplied password.
2852 Although the configuration file permits service names to contain spaces,
2853 your client software may not. Spaces will be ignored in comparisons anyway,
2854 so it shouldn't be a problem - but be aware of the possibility.
2856 On a similar note, many clients - especially DOS clients - limit service
2857 names to eight characters. Smbd has no such limitation, but attempts
2858 to connect from such clients will fail if they truncate the service names.
2859 For this reason you should probably keep your service names down to eight
2860 characters in length.
2862 Use of the [homes] and [printers] special sections make life for an
2863 administrator easy, but the various combinations of default attributes can be
2864 tricky. Take extreme care when designing these sections. In particular,
2865 ensure that the permissions on spool directories are correct.
2867 This man page is (mostly) correct for version 1.9.00 of the Samba suite, plus some
2868 of the recent patches to it. These notes will necessarily lag behind
2869 development of the software, so it is possible that your version of
2870 the server has extensions or parameter semantics that differ from or are not
2871 covered by this man page. Please notify these to the address below for
2874 Prior to version 1.5.21 of the Samba suite, the configuration file was
2875 radically different (more primitive). If you are using a version earlier than
2876 1.8.05, it is STRONGLY recommended that you upgrade.
2881 .SH ENVIRONMENT VARIABLES
2890 .BR hosts_access (5)
2892 [This section under construction]
2894 Most diagnostics issued by the server are logged in a specified log file. The
2895 log file name is specified at compile time, but may be overridden on the
2896 smbd command line (see
2899 The number and nature of diagnostics available depends on the debug level used
2900 by the server. If you have problems, set the debug level to 3 and peruse the
2903 Most messages are reasonably self-explanatory. Unfortunately, at time of
2904 creation of this man page the source code is still too fluid to warrant
2905 describing each and every diagnostic. At this stage your best bet is still
2906 to grep the source code and inspect the conditions that gave rise to the
2907 diagnostics you are seeing.
2911 Please send bug reports, comments and so on to:
2914 .B samba-bugs@samba.anu.edu.au (Andrew Tridgell)
2917 or to the mailing list:
2920 .B samba@listproc.anu.edu.au
2923 You may also like to subscribe to the announcement channel:
2926 .B samba-announce@listproc.anu.edu.au
2929 To subscribe to these lists send a message to
2930 listproc@listproc.anu.edu.au with a body of "subscribe samba Your
2931 Name" or "subscribe samba-announce Your Name".
2933 Errors or suggestions for improvements to the Samba man pages should be
2937 .B samba-bugs@samba.anu.edu.au (Andrew Tridgell)