updates from Buchan
[gd/samba-autobuild/.git] / packaging / Mandrake / smb.conf
1
2 # This is the main Samba configuration file. You should read the
3 # smb.conf(5) manual page in order to understand the options listed
4 # here. Samba has a huge number of configurable options (perhaps too
5 # many!) most of which are not shown in this example
6 #
7 # Any line which starts with a ; (semi-colon) or a # (hash) 
8 # is a comment and is ignored. In this example we will use a #
9 # for commentry and a ; for parts of the config file that you
10 # may wish to enable
11 #
12 # NOTE: Whenever you modify this file you should run the command "testparm"
13 # to check that you have not made any basic syntactic errors. 
14 #
15 #======================= Global Settings =====================================
16 [global]
17
18 # 1. Server Naming Options:
19 # workgroup = NT-Domain-Name or Workgroup-Name
20    workgroup = MDKGROUP
21
22 # netbios name is the name you will see in "Network Neighbourhood",
23 # but defaults to your hostname
24 ;  netbios name = <name_of_this_server>
25
26 # server string is the equivalent of the NT Description field
27    server string = Samba Server %v
28
29 # Message command is run by samba when a "popup" message is sent to it.
30 # The example below is for use with LinPopUp:
31 ; message command = /usr/bin/linpopup "%f" "%m" %s; rm %s
32
33 # 2. Printing Options:
34 # CHANGES TO ENABLE PRINTING ON ALL CUPS PRINTERS IN THE NETWORK
35 # (as cups is now used in linux-mandrake 7.2 by default)
36 # if you want to automatically load your printer list rather
37 # than setting them up individually then you'll need this
38    printcap name = lpstat
39    load printers = yes
40
41 # It should not be necessary to spell out the print system type unless
42 # yours is non-standard. Currently supported print systems include:
43 # bsd, sysv, plp, lprng, aix, hpux, qnx, cups
44    printing = cups
45
46 # Samba 2.2 supports the Windows NT-style point-and-print feature. To
47 # use this, you need to be able to upload print drivers to the samba
48 # server. The printer admins (or root) may install drivers onto samba.
49 # Note that this feature uses the print$ share, so you will need to 
50 # enable it below.
51 # printer admin = @<group> <user>
52 ;   printer admin = @adm
53 # This should work well for winbind:
54 ;   printer admin = @"Domain Admins"
55
56 # 3. Logging Options:
57 # this tells Samba to use a separate log file for each machine
58 # that connects
59    log file = /var/log/samba/log.%m
60
61 # Put a capping on the size of the log files (in Kb).
62    max log size = 50
63
64 # Set the log (verbosity) level (0 <= log level <= 10)
65 ; log level = 3
66
67 # 4. Security and Domain Membership Options:
68 # This option is important for security. It allows you to restrict
69 # connections to machines which are on your local network. The
70 # following example restricts access to two C class networks and
71 # the "loopback" interface. For more examples of the syntax see
72 # the smb.conf man page. Do not enable this if (tcp/ip) name resolution does
73 # not work for all the hosts in your network.
74 ;   hosts allow = 192.168.1. 192.168.2. 127.
75
76 # Uncomment this if you want a guest account, you must add this to /etc/passwd
77 # otherwise the user "nobody" is used
78 ;  guest account = pcguest
79 # Allow users to map to guest:
80   map to guest = bad user
81
82 # Security mode. Most people will want user level security. See
83 # security_level.txt for details.
84    security = user
85 # Use password server option only with security = server or security = domain
86 # When using security = domain, you should use password server = *
87 ;   password server = <NT-Server-Name>
88 ;   password server = *
89
90 # Password Level allows matching of _n_ characters of the password for
91 # all combinations of upper and lower case.
92 ;  password level = 8
93 ;  username level = 8
94
95 # You may wish to use password encryption. Please read
96 # ENCRYPTION.txt, Win95.txt and WinNT.txt in the Samba documentation.
97 # Do not enable this option unless you have read those documents
98 # Encrypted passwords are required for any use of samba in a Windows NT domain
99 # The smbpasswd file is only required by a server doing authentication, thus
100 # members of a domain do not need one.
101   encrypt passwords = yes
102   smb passwd file = /etc/samba/smbpasswd
103
104 # The following are needed to allow password changing from Windows to
105 # also update the Linux system password.
106 # NOTE: Use these with 'encrypt passwords' and 'smb passwd file' above.
107 # NOTE2: You do NOT need these to allow workstations to change only
108 #        the encrypted SMB passwords. They allow the Unix password
109 #        to be kept in sync with the SMB password.
110 ;  unix password sync = Yes
111 # You either need to setup a passwd program and passwd chat, or
112 # enable pam password change
113 ;  pam password change = yes
114 ;  passwd program = /usr/bin/passwd %u
115 ;  passwd chat = *New*UNIX*password* %n\n *Re*ype*new*UNIX*password* %n\n \
116 ;*passwd:*all*authentication*tokens*updated*successfully*
117
118 # Unix users can map to different SMB User names
119 ;  username map = /etc/samba/smbusers
120
121 # Using the following line enables you to customise your configuration
122 # on a per machine basis. The %m gets replaced with the netbios name
123 # of the machine that is connecting
124 ;   include = /etc/samba/smb.conf.%m
125
126 # Options for using winbind. Winbind allows you to do all account and
127 # authentication from a Windows or samba domain controller, creating
128 # accounts on the fly, and maintaining a mapping of Windows RIDs to unix uid's 
129 # and gid's. winbind uid and winbind gid are the only required parameters.
130 #
131 # winbind uid is the range of uid's winbind can use when mapping RIDs to uid's
132 ;  winbind uid = 10000-20000
133 #
134 # winbind gid is the range of uid's winbind can use when mapping RIDs to gid's
135 ;  winbind gid = 10000-20000
136 #
137 # winbind separator is the character a user must use between their domain
138 # name and username, defaults to "\"
139 ;  winbind separator = +
140 #
141 # winbind use default domain allows you to have winbind return usernames
142 # in the form user instead of DOMAIN+user for the domain listed in the
143 # workgroup parameter.
144 ;  winbind use default domain = yes
145 #
146 # template homedir determines the home directory for winbind users, with 
147 # %D expanding to their domain name and %U expanding to their username:
148 ;  template homedir = /home/%D/%U
149
150 # When using winbind, you may want to have samba create home directories
151 # on the fly for authenticated users. Ensure that /etc/pam.d/samba is
152 # using 'service=system-auth-winbind' in pam_stack modules, and then
153 # enable obedience of pam restrictions below:
154 ;  obey pam restrictions = yes
155
156 #
157 # template shell determines the shell users authenticated by winbind get
158 ;  template shell = /bin/bash
159
160 # 5. Browser Control and Networking Options:
161 # Most people will find that this option gives better performance.
162 # See speed.txt and the manual pages for details
163    socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
164
165 # Configure Samba to use multiple interfaces
166 # If you have multiple network interfaces then you must list them
167 # here. See the man page for details.
168 ;   interfaces = 192.168.12.2/24 192.168.13.2/24 
169
170 # Configure remote browse list synchronisation here
171 #  request announcement to, or browse list sync from:
172 #       a specific host or from / to a whole subnet (see below)
173 ;   remote browse sync = 192.168.3.25 192.168.5.255
174 # Cause this host to announce itself to local subnets here
175 ;   remote announce = 192.168.1.255 192.168.2.44
176
177 # set local master to no if you don't want Samba to become a master
178 # browser on your network. Otherwise the normal election rules apply
179 ;   local master = no
180
181 # OS Level determines the precedence of this server in master browser
182 # elections. The default value should be reasonable
183 ;   os level = 33
184
185 # Domain Master specifies Samba to be the Domain Master Browser. This
186 # allows Samba to collate browse lists between subnets. Don't use this
187 # if you already have a Windows NT domain controller doing this job
188 ;   domain master = yes 
189
190 # Preferred Master causes Samba to force a local browser election on startup
191 # and gives it a slightly higher chance of winning the election
192 ;   preferred master = yes
193
194 # 6. Domain Control Options:
195 # Enable this if you want Samba to be a domain logon server for 
196 # Windows95 workstations or Primary Domain Controller for WinNT and Win2k
197 ;   domain logons = yes
198
199 # if you enable domain logons then you may want a per-machine or
200 # per user logon script
201 # run a specific logon batch file per workstation (machine)
202 ;   logon script = %m.bat
203 # run a specific logon batch file per username
204 ;   logon script = %U.bat
205
206 # Where to store roaming profiles for WinNT and Win2k
207 #        %L substitutes for this servers netbios name, %U is username
208 #        You must uncomment the [Profiles] share below
209 ;   logon path = \\%L\Profiles\%U
210
211 # Where to store roaming profiles for Win9x. Be careful with this as it also
212 # impacts where Win2k finds it's /HOME share
213 ; logon home = \\%L\%U\.profile
214
215
216 # The add user script is used by a domain member to add local user accounts
217 # that have been authenticated by the domain controller, or when adding
218 # users via the Windows NT Tools (ie User Manager for Domains).
219
220 # Scripts for file (passwd, smbpasswd) backend:
221 ; add user script = /usr/sbin/useradd -s /bin/false '%u'
222 ; delete user script = /usr/sbin/userdel '%s'
223 ; add user to group script = /usr/bin/gpasswd -a '%u' '%g'
224 ; delete user from group script = /usr/bin/gpasswd -d '%u' '%g'
225 ; set primary group script = /usr/sbin/usermod -g '%g' '%u'
226 ; add group script = /usr/sbin/groupadd %g && getent group '%g'|awk -F: '{print $3}'
227 ; delete group script = /usr/sbin/groupdel '%g'
228
229 # Scripts for LDAP backend (assumes nss_ldap is in use on the domain controller,
230 # and needs configuration in smbldap_conf.pm
231 ; add user script = /usr/share/samba/scripts/smbldap-useradd.pl '%u'
232 ; delete user script = /usr/share/samba/scripts/smbldap-userdel.pl '%u'
233 ; add user to group script = /usr/share/samba/scripts/smbldap-groupmod.pl -m '%u' '%g'
234 ; delete user from group script = /usr/share/samba/scripts/smbldap-groupmod.pl -x '%u' '%g'
235 ; set primary group script = /usr/share/samba/scripts/smbldap-usermod.pl -g '%g' '%u'
236 ; add group script = /usr/share/samba/scripts/smbldap-groupadd.pl '%g' && /usr/share/samba/scripts/smbldap-groupshow.pl %g|awk '/^gidNumber:/ {print $2}'
237 ; delete group script = /usr/share/samba/scripts/smbldap-userdel.pl '%g'
238
239
240 # The add machine script is use by a samba server configured as a domain
241 # controller to add local machine accounts when adding machines to the domain.
242 # The script must work from the command line when replacing the macros,
243 # or the operation will fail. Check that groups exist if forcing a group.
244 # Script for domain controller for adding machines:
245 ; add machine script = /usr/sbin/useradd -d /dev/null -g machines -c 'Machine Account' -s /bin/false -M %u
246 # Script for domain controller with LDAP backend for adding machines (please
247 # configure in /etc/samba/smbldap_conf.pm first):
248 ; add machine script = /usr/share/samba/scripts/smbldap-useradd.pl -w -d /dev/null -g machines -c 'Machine Account' -s /bin/false %u
249
250 # Domain groups:
251 # Domain groups are now configured by using the 'net groupmap' tool
252
253 # Samba Password Database configuration:
254 # Samba now has runtime-configurable password database backends. Multiple
255 # passdb backends may be used, but users will only be added to the first one
256 # Default:
257 ; passdb backend = smbpasswd guest
258 # TDB backen with fallback to smbpasswd and guest
259 ; passdb backend = tdbsam smbpasswd guest
260 # LDAP with fallback to smbpasswd guest
261 # Enable SSL by using an ldaps url, or enable tls with 'ldap ssl' below.
262 ; passdb backend = ldapsam:ldaps://ldap.mydomain.com smbpasswd guest
263 # Use the samba2 LDAP schema:
264 ; passdb backend = ldapsam_compat:ldaps://ldap.mydomain.com smbpasswd guest
265
266 # Idmap settings:
267 # Idmap backend to use:
268 ; idmap backend = ldap:ldap://ldap.mydomain.com
269
270 # This is a range of unix user-id's that samba will map non-unix RIDs to,
271 # such as when using Winbind
272 ; idmap uid = 10000-20000
273 ; idmap gid = 10000-20000
274   
275 # LDAP configuration for Domain Controlling:
276 # The account (dn) that samba uses to access the LDAP server
277 # This account needs to have write access to the LDAP tree
278 # You will need to give samba the password for this dn, by 
279 # running 'smbpasswd -w mypassword'
280 ; ldap admin dn = cn=root,dc=mydomain,dc=com
281 ; ldap ssl = start_tls
282 # start_tls should run on 389, but samba defaults incorrectly to 636
283 ; ldap port = 389
284 ; ldap suffix = dc=mydomain,dc=com
285 # Seperate suffixes are available for machines, users, groups, and idmap, if 
286 # ldap suffix appears first, it is appended to the specific suffix.
287 # Example for a unix-ish directory layout:
288 ; ldap machine suffix = ou=Hosts
289 ; ldap user suffix = ou=People
290 ; ldap group suffix = ou=Group
291 ; ldap idmap suffix = ou=Idmap
292 # Example for AD-ish layout:
293 ; ldap machine suffix = cn=Computers
294 ; ldap user suffix = cn=Users
295 ; ldap group suffix = cn=Groups
296 ; ldap idmap suffix = cn=Idmap
297
298
299 # 7. Name Resolution Options:
300 # All NetBIOS names must be resolved to IP Addresses
301 # 'Name Resolve Order' allows the named resolution mechanism to be specified
302 # the default order is "host lmhosts wins bcast". "host" means use the unix
303 # system gethostbyname() function call that will use either /etc/hosts OR
304 # DNS or NIS depending on the settings of /etc/host.config, /etc/nsswitch.conf
305 # and the /etc/resolv.conf file. "host" therefore is system configuration
306 # dependant. This parameter is most often of use to prevent DNS lookups
307 # in order to resolve NetBIOS names to IP Addresses. Use with care!
308 # The example below excludes use of name resolution for machines that are NOT
309 # on the local network segment
310 # - OR - are not deliberately to be known via lmhosts or via WINS.
311 ; name resolve order = wins lmhosts bcast
312
313 # Windows Internet Name Serving Support Section:
314 # WINS Support - Tells the NMBD component of Samba to enable it's WINS Server
315 ;   wins support = yes
316
317 # WINS Server - Tells the NMBD components of Samba to be a WINS Client
318 #       Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
319 ;   wins server = w.x.y.z
320
321 # WINS Proxy - Tells Samba to answer name resolution queries on
322 # behalf of a non WINS capable client, for this to work there must be
323 # at least one  WINS Server on the network. The default is NO.
324 ;   wins proxy = yes
325
326 # DNS Proxy - tells Samba whether or not to try to resolve NetBIOS names
327 # via DNS nslookups. The built-in default for versions 1.9.17 is yes,
328 # this has been changed in version 1.9.18 to no.
329    dns proxy = no 
330
331 # 8. File Naming Options:
332 # Case Preservation can be handy - system default is _no_
333 # NOTE: These can be set on a per share basis
334 ;  preserve case = no
335 ;  short preserve case = no
336 # Default case is normally upper case for all DOS files
337 ;  default case = lower
338 # Be very careful with case sensitivity - it can break things!
339 ;  case sensitive = no
340
341 # Enabling internationalization:
342 # you can match a Windows code page with a UNIX character set.
343 # Windows: 437 (US), 737 (GREEK), 850 (Latin1 - Western European),
344 # 852 (Eastern Eu.), 861 (Icelandic), 932 (Cyrillic - Russian),
345 # 936 (Japanese - Shift-JIS), 936 (Simpl. Chinese), 949 (Korean Hangul),
346 # 950 (Trad. Chin.).
347 # UNIX: ISO8859-1 (Western European), ISO8859-2 (Eastern Eu.),
348 # ISO8859-5 (Russian Cyrillic), KOI8-R (Alt-Russ. Cyril.)
349 # This is an example for french users:
350 ;   dos charset = 850
351 ;   unix charset = ISO8859-1
352
353
354 #============================ Share Definitions ==============================
355 [homes]
356    comment = Home Directories
357    browseable = no
358    writable = yes
359 # You can enable VFS recycle bin on a per share basis:
360 # Uncomment the next 2 lines (make sure you create a
361 # .recycle folder in the base of the share and ensure
362 # all users will have write access to it. See
363 # examples/VFS/recycle/REAME in samba-doc for details
364 ;   vfs object = /usr/lib/samba/vfs/recycle.so
365
366 # Un-comment the following and create the netlogon directory for Domain Logons
367 ; [netlogon]
368 ;   comment = Network Logon Service
369 ;   path = /var/lib/samba/netlogon
370 ;   guest ok = yes
371 ;   writable = no
372
373 #Uncomment the following 2 lines if you would like your login scripts to
374 #be created dynamically by ntlogon (check that you have it in the correct
375 #location (the default of the ntlogon rpm available in contribs)
376 ;root preexec = /usr/bin/ntlogon -u %U -g %G -o %a -d /var/lib/samba/netlogon
377 ;root postexec = rm -f /var/lib/samba/netlogon/%U.bat
378
379 # Un-comment the following to provide a specific roving profile share
380 # the default is to use the user's home directory
381 ;[Profiles]
382 ;    path = /var/lib/samba/profiles
383 ;    browseable = no
384 ;    guest ok = yes
385 # This script can be enabled to create profile directories on the fly
386 # You may want to turn off guest acces if you enable this, as it
387 # hasn't been thoroughly tested.
388 ;root preexec = PROFILE=/var/lib/samba/profiles/%u; if [ ! -e $PROFILE ]; \
389 ;                then mkdir -pm700 $PROFILE; chown %u.%g $PROFILE;fi
390
391 # NOTE: If you have a CUPS print system there is no need to 
392 # specifically define each individual printer.
393 # You must configure the samba printers with the appropriate Windows
394 # drivers on your Windows clients or upload the printer driver to the
395 # server from Windows (NT/2000/XP). On the Samba server no filtering is
396 # done. If you wish that the server provides the driver and the clients
397 # send PostScript ("Generic PostScript Printer" under Windows), you have
398 # to use 'printcap name = cups' or swap the 'print command' line below 
399 # with the commented one. Note that print commands only work if not using 
400 # 'printing=cups'
401 [printers]
402    comment = All Printers
403    path = /var/spool/samba
404    browseable = no
405 # to allow user 'guest account' to print.
406    guest ok = yes
407    writable = no
408    printable = yes
409    create mode = 0700
410 # =====================================
411 # print command: see above for details.
412 # =====================================
413    print command = lpr-cups -P %p -o raw %s -r   # using client side printer drivers.
414 ;   print command = lpr-cups -P %p %s # using cups own drivers (use generic PostScript on clients).
415
416 # This share is used for Windows NT-style point-and-print support.
417 # To be able to install drivers, you need to be either root, or listed
418 # in the printer admin parameter above. Note that you also need write access
419 # to the directory and share definition to be able to upload the drivers.
420 # For more information on this, please see the Printing Support Section of
421 # /usr/share/doc/samba-<version>/docs/Samba-HOWTO-Collection.pdf 
422 #
423 # A special case is using the CUPS Windows Postscript driver, which allows
424 # all features available via CUPS on the client, by publishing the ppd file
425 # and the cups driver by using the 'cupsaddsmb' tool. This requires the
426 # installation of the CUPS driver (http://www.cups.org/windows.php) 
427 # on the server, but doesn't require you to use Windows at all :-).
428 [print$]
429    path = /var/lib/samba/printers
430    browseable = yes
431    write list = @adm root
432    guest ok = yes
433    inherit permissions = yes
434    # Settings suitable for Winbind:
435    ; write list = @"Domain Admins" root
436    ; force group = +@"Domain Admins"
437
438 # A useful application of samba is to make a PDF-generation service
439 # To streamline this, install windows postscript drivers (preferably colour)
440 # on the samba server, so that clients can automatically install them.
441 # Note that this only works if 'printing' is *not* set to 'cups'
442
443 [pdf-generator]
444    path = /var/tmp
445    guest ok = No
446    printable = Yes
447    comment = PDF Generator (only valid users)
448    #print command = /usr/share/samba/scripts/print-pdf file path win_path recipient IP &
449    print command = /usr/share/samba/scripts/print-pdf %s ~%u //%L/%u %m %I "%J" &
450
451 # This one is useful for people to share files
452 ;[tmp]
453 ;   comment = Temporary file space
454 ;   path = /tmp
455 ;   read only = no
456 ;   public = yes
457
458 # A publicly accessible directory, but read only, except for people in
459 # the "staff" group
460 ;[public]
461 ;   comment = Public Stuff
462 ;   path = /home/samba/public
463 ;   public = yes
464 ;   writable = no
465 ;   write list = @staff
466 # Audited directory through experimental VFS audit.so module:
467 # Uncomment next line.
468 ;   vfs object = /usr/lib/samba/vfs/audit.so
469
470 # Other examples. 
471 #
472 # A private printer, usable only by Fred. Spool data will be placed in Fred's
473 # home directory. Note that fred must have write access to the spool directory,
474 # wherever it is.
475 ;[fredsprn]
476 ;   comment = Fred's Printer
477 ;   valid users = fred
478 ;   path = /homes/fred
479 ;   printer = freds_printer
480 ;   public = no
481 ;   writable = no
482 ;   printable = yes
483
484 # A private directory, usable only by Fred. Note that Fred requires write
485 # access to the directory.
486 ;[fredsdir]
487 ;   comment = Fred's Service
488 ;   path = /usr/somewhere/private
489 ;   valid users = fred
490 ;   public = no
491 ;   writable = yes
492 ;   printable = no
493
494 # a service which has a different directory for each machine that connects
495 # this allows you to tailor configurations to incoming machines. You could
496 # also use the %u option to tailor it by user name.
497 # The %m gets replaced with the machine name that is connecting.
498 ;[pchome]
499 ;  comment = PC Directories
500 ;  path = /usr/pc/%m
501 ;  public = no
502 ;  writable = yes
503
504 # A publicly accessible directory, read/write to all users. Note that all files
505 # created in the directory by users will be owned by the default user, so
506 # any user with access can delete any other user's files. Obviously this
507 # directory must be writable by the default user. Another user could of course
508 # be specified, in which case all files would be owned by that user instead.
509 ;[public]
510 ;   path = /usr/somewhere/else/public
511 ;   public = yes
512 ;   only guest = yes
513 ;   writable = yes
514 ;   printable = no
515
516 # The following two entries demonstrate how to share a directory so that two
517 # users can place files there that will be owned by the specific users. In this
518 # setup, the directory should be writable by both users and should have the
519 # sticky bit set on it to prevent abuse. Obviously this could be extended to
520 # as many users as required.
521 ;[myshare]
522 ;   comment = Mary's and Fred's stuff
523 ;   path = /usr/somewhere/shared
524 ;   valid users = mary fred
525 ;   public = no
526 ;   writable = yes
527 ;   printable = no
528 ;   create mask = 0765
529