smb.conf 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  1. #
  2. # Sample configuration file for the Samba suite for Debian GNU/Linux.
  3. #
  4. #
  5. # This is the main Samba configuration file. You should read the
  6. # smb.conf(5) manual page in order to understand the options listed
  7. # here. Samba has a huge number of configurable options most of which
  8. # are not shown in this example
  9. #
  10. # Some options that are often worth tuning have been included as
  11. # commented-out examples in this file.
  12. # - When such options are commented with ";", the proposed setting
  13. # differs from the default Samba behaviour
  14. # - When commented with "#", the proposed setting is the default
  15. # behaviour of Samba but the option is considered important
  16. # enough to be mentioned here
  17. #
  18. # NOTE: Whenever you modify this file you should run the command
  19. # "testparm" to check that you have not made any basic syntactic
  20. # errors.
  21. #======================= Global Settings =======================
  22. [global]
  23. ## Browsing/Identification ###
  24. # Change this to the workgroup/NT-domain name your Samba server will part of
  25. workgroup = WORKGROUP
  26. # Windows Internet Name Serving Support Section:
  27. # WINS Support - Tells the NMBD component of Samba to enable its WINS Server
  28. # wins support = no
  29. # WINS Server - Tells the NMBD components of Samba to be a WINS Client
  30. # Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
  31. ; wins server = w.x.y.z
  32. # This will prevent nmbd to search for NetBIOS names through DNS.
  33. dns proxy = no
  34. #### Networking ####
  35. # The specific set of interfaces / networks to bind to
  36. # This can be either the interface name or an IP address/netmask;
  37. # interface names are normally preferred
  38. ; interfaces = 127.0.0.0/8 eth0
  39. # Only bind to the named interfaces and/or networks; you must use the
  40. # 'interfaces' option above to use this.
  41. # It is recommended that you enable this feature if your Samba machine is
  42. # not protected by a firewall or is a firewall itself. However, this
  43. # option cannot handle dynamic or non-broadcast interfaces correctly.
  44. ; bind interfaces only = yes
  45. #### Debugging/Accounting ####
  46. # This tells Samba to use a separate log file for each machine
  47. # that connects
  48. log file = /var/log/samba/log.%m
  49. # Cap the size of the individual log files (in KiB).
  50. max log size = 1000
  51. # If you want Samba to only log through syslog then set the following
  52. # parameter to 'yes'.
  53. # syslog only = no
  54. # We want Samba to log a minimum amount of information to syslog. Everything
  55. # should go to /var/log/samba/log.{smbd,nmbd} instead. If you want to log
  56. # through syslog you should set the following parameter to something higher.
  57. syslog = 0
  58. # Do something sensible when Samba crashes: mail the admin a backtrace
  59. panic action = /usr/share/samba/panic-action %d
  60. ####### Authentication #######
  61. # Server role. Defines in which mode Samba will operate. Possible
  62. # values are "standalone server", "member server", "classic primary
  63. # domain controller", "classic backup domain controller", "active
  64. # directory domain controller".
  65. #
  66. # Most people will want "standalone sever" or "member server".
  67. # Running as "active directory domain controller" will require first
  68. # running "samba-tool domain provision" to wipe databases and create a
  69. # new domain.
  70. server role = standalone server
  71. # If you are using encrypted passwords, Samba will need to know what
  72. # password database type you are using.
  73. passdb backend = tdbsam
  74. obey pam restrictions = yes
  75. # This boolean parameter controls whether Samba attempts to sync the Unix
  76. # password with the SMB password when the encrypted SMB password in the
  77. # passdb is changed.
  78. unix password sync = yes
  79. # For Unix password sync to work on a Debian GNU/Linux system, the following
  80. # parameters must be set (thanks to Ian Kahan <<kahan@informatik.tu-muenchen.de> for
  81. # sending the correct chat script for the passwd program in Debian Sarge).
  82. passwd program = /usr/bin/passwd %u
  83. passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
  84. # This boolean controls whether PAM will be used for password changes
  85. # when requested by an SMB client instead of the program listed in
  86. # 'passwd program'. The default is 'no'.
  87. pam password change = yes
  88. # This option controls how unsuccessful authentication attempts are mapped
  89. # to anonymous connections
  90. map to guest = bad user
  91. guest account = mpd
  92. ########## Domains ###########
  93. #
  94. # The following settings only takes effect if 'server role = primary
  95. # classic domain controller', 'server role = backup domain controller'
  96. # or 'domain logons' is set
  97. #
  98. # It specifies the location of the user's
  99. # profile directory from the client point of view) The following
  100. # required a [profiles] share to be setup on the samba server (see
  101. # below)
  102. ; logon path = \\%N\profiles\%U
  103. # Another common choice is storing the profile in the user's home directory
  104. # (this is Samba's default)
  105. # logon path = \\%N\%U\profile
  106. # The following setting only takes effect if 'domain logons' is set
  107. # It specifies the location of a user's home directory (from the client
  108. # point of view)
  109. ; logon drive = H:
  110. # logon home = \\%N\%U
  111. # The following setting only takes effect if 'domain logons' is set
  112. # It specifies the script to run during logon. The script must be stored
  113. # in the [netlogon] share
  114. # NOTE: Must be store in 'DOS' file format convention
  115. ; logon script = logon.cmd
  116. # This allows Unix users to be created on the domain controller via the SAMR
  117. # RPC pipe. The example command creates a user account with a disabled Unix
  118. # password; please adapt to your needs
  119. ; add user script = /usr/sbin/adduser --quiet --disabled-password --gecos "" %u
  120. # This allows machine accounts to be created on the domain controller via the
  121. # SAMR RPC pipe.
  122. # The following assumes a "machines" group exists on the system
  123. ; add machine script = /usr/sbin/useradd -g machines -c "%u machine account" -d /var/lib/samba -s /bin/false %u
  124. # This allows Unix groups to be created on the domain controller via the SAMR
  125. # RPC pipe.
  126. ; add group script = /usr/sbin/addgroup --force-badname %g
  127. ############ Misc ############
  128. # Using the following line enables you to customise your configuration
  129. # on a per machine basis. The %m gets replaced with the netbios name
  130. # of the machine that is connecting
  131. ; include = /home/samba/etc/smb.conf.%m
  132. # Some defaults for winbind (make sure you're not using the ranges
  133. # for something else.)
  134. ; idmap uid = 10000-20000
  135. ; idmap gid = 10000-20000
  136. ; template shell = /bin/bash
  137. # Setup usershare options to enable non-root users to share folders
  138. # with the net usershare command.
  139. # Maximum number of usershare. 0 (default) means that usershare is disabled.
  140. ; usershare max shares = 100
  141. # Allow users who've been granted usershare privileges to create
  142. # public shares, not just authenticated ones
  143. usershare allow guests = yes
  144. #======================= Share Definitions =======================
  145. [homes]
  146. comment = Home Directories
  147. browseable = no
  148. # By default, the home directories are exported read-only. Change the
  149. # next parameter to 'no' if you want to be able to write to them.
  150. read only = yes
  151. # File creation mask is set to 0700 for security reasons. If you want to
  152. # create files with group=rw permissions, set next parameter to 0775.
  153. create mask = 0700
  154. # Directory creation mask is set to 0700 for security reasons. If you want to
  155. # create dirs. with group=rw permissions, set next parameter to 0775.
  156. directory mask = 0700
  157. # By default, \\server\username shares can be connected to by anyone
  158. # with access to the samba server.
  159. # The following parameter makes sure that only "username" can connect
  160. # to \\server\username
  161. # This might need tweaking when using external authentication schemes
  162. valid users = %S
  163. # Un-comment the following and create the netlogon directory for Domain Logons
  164. # (you need to configure Samba to act as a domain controller too.)
  165. ;[netlogon]
  166. ; comment = Network Logon Service
  167. ; path = /home/samba/netlogon
  168. ; guest ok = yes
  169. ; read only = yes
  170. # Un-comment the following and create the profiles directory to store
  171. # users profiles (see the "logon path" option above)
  172. # (you need to configure Samba to act as a domain controller too.)
  173. # The path below should be writable by all users so that their
  174. # profile directory may be created the first time they log on
  175. ;[profiles]
  176. ; comment = Users profiles
  177. ; path = /home/samba/profiles
  178. ; guest ok = no
  179. ; browseable = no
  180. ; create mask = 0600
  181. ; directory mask = 0700
  182. [printers]
  183. comment = All Printers
  184. browseable = no
  185. path = /var/spool/samba
  186. printable = yes
  187. guest ok = no
  188. read only = yes
  189. create mask = 0700
  190. # Windows clients look for this share name as a source of downloadable
  191. # printer drivers
  192. [print$]
  193. comment = Printer Drivers
  194. path = /var/lib/samba/printers
  195. browseable = yes
  196. read only = yes
  197. guest ok = no
  198. # Uncomment to allow remote administration of Windows print drivers.
  199. # You may need to replace 'lpadmin' with the name of the group your
  200. # admin users are members of.
  201. # Please note that you also need to set appropriate Unix permissions
  202. # to the drivers directory for these users to have write rights in it
  203. ; write list = root, @lpadmin
  204. #[extSD]
  205. # path = /extSD
  206. # browseable = yes
  207. # read only = yes
  208. # guest ok = yes
  209. # create mask = 0666
  210. # directory mask = 0777
  211. [settings]
  212. path = /home/mpd
  213. browseable = yes
  214. read only = no
  215. writable = yes
  216. guest ok = yes
  217. guest account = mpd
  218. create mask = 0666
  219. directory mask = 0777