cfgparser.2 19 KB

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