Jeoxs

smb.conf

Jun 1st, 2016
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.12 KB | None | 0 0
  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.  
  22. #======================= Global Settings =======================
  23.  
  24. [global]
  25.  
  26. ## Browsing/Identification ###
  27.  
  28. # Change this to the workgroup/NT-domain name your Samba server will part of
  29.  
  30. workgroup = DOMAIN
  31. #client singing = yes
  32. client use spnego = yes
  33. kerberos method = secrets and keytab
  34. realm = DOMAIN.local
  35. security = ads
  36. winbind use default domain = Yes
  37. winbind offline logon = true
  38. winbind enum users = Yes
  39. winbind enum groups = Yes
  40. template homedir = /home/%D/%U
  41. template shell = /bin/bash
  42.  
  43. # server string is the equivalent of the NT Description field
  44. server string = %h server (Samba, Ubuntu)
  45.  
  46. # Windows Internet Name Serving Support Section:
  47. # WINS Support - Tells the NMBD component of Samba to enable its WINS Server
  48. # wins support = no
  49.  
  50. # WINS Server - Tells the NMBD components of Samba to be a WINS Client
  51. # Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
  52. ; wins server = w.x.y.z
  53.  
  54. # This will prevent nmbd to search for NetBIOS names through DNS.
  55. dns proxy = no
  56.  
  57. #### Networking ####
  58.  
  59. # The specific set of interfaces / networks to bind to
  60. # This can be either the interface name or an IP address/netmask;
  61. # interface names are normally preferred
  62. ; interfaces = 127.0.0.0/8 eth0
  63.  
  64. # Only bind to the named interfaces and/or networks; you must use the
  65. # 'interfaces' option above to use this.
  66. # It is recommended that you enable this feature if your Samba machine is
  67. # not protected by a firewall or is a firewall itself. However, this
  68. # option cannot handle dynamic or non-broadcast interfaces correctly.
  69. ; bind interfaces only = yes
  70.  
  71.  
  72.  
  73. #### Debugging/Accounting ####
  74.  
  75. # This tells Samba to use a separate log file for each machine
  76. # that connects
  77. log file = /var/log/samba/log.%m
  78.  
  79. # Cap the size of the individual log files (in KiB).
  80. max log size = 1000
  81.  
  82. # If you want Samba to only log through syslog then set the following
  83. # parameter to 'yes'.
  84. # syslog only = no
  85.  
  86. # We want Samba to log a minimum amount of information to syslog. Everything
  87. # should go to /var/log/samba/log.{smbd,nmbd} instead. If you want to log
  88. # through syslog you should set the following parameter to something higher.
  89. syslog = 0
  90.  
  91. # Do something sensible when Samba crashes: mail the admin a backtrace
  92. panic action = /usr/share/samba/panic-action %d
  93.  
  94.  
  95. ####### Authentication #######
  96.  
  97. # Server role. Defines in which mode Samba will operate. Possible
  98. # values are "standalone server", "member server", "classic primary
  99. # domain controller", "classic backup domain controller", "active
  100. # directory domain controller".
  101. #
  102. # Most people will want "standalone sever" or "member server".
  103. # Running as "active directory domain controller" will require first
  104. # running "samba-tool domain provision" to wipe databases and create a
  105. # new domain.
  106. server role = standalone server
  107.  
  108. # If you are using encrypted passwords, Samba will need to know what
  109. # password database type you are using.
  110. passdb backend = tdbsam
  111.  
  112. obey pam restrictions = yes
  113.  
  114. # This boolean parameter controls whether Samba attempts to sync the Unix
  115. # password with the SMB password when the encrypted SMB password in the
  116. # passdb is changed.
  117. unix password sync = yes
  118.  
  119. # For Unix password sync to work on a Debian GNU/Linux system, the following
  120. # parameters must be set (thanks to Ian Kahan <<[email protected]> for
  121. # sending the correct chat script for the passwd program in Debian Sarge).
  122. passwd program = /usr/bin/passwd %u
  123. passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
  124.  
  125. # This boolean controls whether PAM will be used for password changes
  126. # when requested by an SMB client instead of the program listed in
  127. # 'passwd program'. The default is 'no'.
  128. pam password change = yes
  129.  
  130. # This option controls how unsuccessful authentication attempts are mapped
  131. # to anonymous connections
  132. map untrusted to domain = Yes
  133. map to guest = bad user
  134.  
  135. ########## Domains ###########
  136.  
  137. #
  138. # The following settings only takes effect if 'server role = primary
  139. # classic domain controller', 'server role = backup domain controller'
  140. # or 'domain logons' is set
  141. #
  142.  
  143. # It specifies the location of the user's
  144. # profile directory from the client point of view) The following
  145. # required a [profiles] share to be setup on the samba server (see
  146. # below)
  147. ; logon path = \\%N\profiles\%U
  148. # Another common choice is storing the profile in the user's home directory
  149. # (this is Samba's default)
  150. # logon path = \\%N\%U\profile
  151.  
  152. # The following setting only takes effect if 'domain logons' is set
  153. # It specifies the location of a user's home directory (from the client
  154. # point of view)
  155. ; logon drive = H:
  156. # logon home = \\%N\%U
  157.  
  158. # The following setting only takes effect if 'domain logons' is set
  159. # It specifies the script to run during logon. The script must be stored
  160. # in the [netlogon] share
  161. # NOTE: Must be store in 'DOS' file format convention
  162. ; logon script = logon.cmd
  163.  
  164. # This allows Unix users to be created on the domain controller via the SAMR
  165. # RPC pipe. The example command creates a user account with a disabled Unix
  166. # password; please adapt to your needs
  167. ; add user script = /usr/sbin/adduser --quiet --disabled-password --gecos "" %u
  168.  
  169. # This allows machine accounts to be created on the domain controller via the
  170. # SAMR RPC pipe.
  171. # The following assumes a "machines" group exists on the system
  172. ; add machine script = /usr/sbin/useradd -g machines -c "%u machine account" -d /var/lib/samba -s /bin/false %u
  173.  
  174. # This allows Unix groups to be created on the domain controller via the SAMR
  175. # RPC pipe.
  176. ; add group script = /usr/sbin/addgroup --force-badname %g
  177.  
  178. ############ Misc ############
  179.  
  180. # Using the following line enables you to customise your configuration
  181. # on a per machine basis. The %m gets replaced with the netbios name
  182. # of the machine that is connecting
  183. ; include = /home/samba/etc/smb.conf.%m
  184.  
  185. # Some defaults for winbind (make sure you're not using the ranges
  186. # for something else.)
  187. idmap uid = 1000000000-4999999999
  188. idmap gid = 1000000000-4999999999
  189. template shell = /bin/bash
  190. ; idmap backend = TDB
  191. idmap config * : range = 1000000000-4999999999
  192. idmap config * : backend = tdb
  193. idmap config DOMAIN : backend = rid
  194. idmap config DOMAIN : range = 1000000000-4999999999
  195.  
  196.  
  197. # Setup usershare options to enable non-root users to share folders
  198. # with the net usershare command.
  199.  
  200. # Maximum number of usershare. 0 (default) means that usershare is disabled.
  201. ; usershare max shares = 100
  202.  
  203. # Allow users who've been granted usershare privileges to create
  204. # public shares, not just authenticated ones
  205. usershare allow guests = yes
  206.  
  207. #======================= Share Definitions =======================
  208.  
  209. # Un-comment the following (and tweak the other settings below to suit)
  210. # to enable the default home directory shares. This will share each
  211. # user's home directory as \\server\username
  212. ;[homes]
  213. ; comment = Home Directories
  214. ; browseable = no
  215.  
  216. # By default, the home directories are exported read-only. Change the
  217. # next parameter to 'no' if you want to be able to write to them.
  218. ; read only = yes
  219.  
  220. # File creation mask is set to 0700 for security reasons. If you want to
  221. # create files with group=rw permissions, set next parameter to 0775.
  222. ; create mask = 0700
  223.  
  224. # Directory creation mask is set to 0700 for security reasons. If you want to
  225. # create dirs. with group=rw permissions, set next parameter to 0775.
  226. ; directory mask = 0700
  227.  
  228. # By default, \\server\username shares can be connected to by anyone
  229. # with access to the samba server.
  230. # Un-comment the following parameter to make sure that only "username"
  231. # can connect to \\server\username
  232. # This might need tweaking when using external authentication schemes
  233. ; valid users = %S
  234.  
  235. # Un-comment the following and create the netlogon directory for Domain Logons
  236. # (you need to configure Samba to act as a domain controller too.)
  237. ;[netlogon]
  238. ; comment = Network Logon Service
  239. ; path = /home/samba/netlogon
  240. ; guest ok = yes
  241. ; read only = yes
  242.  
  243. # Un-comment the following and create the profiles directory to store
  244. # users profiles (see the "logon path" option above)
  245. # (you need to configure Samba to act as a domain controller too.)
  246. # The path below should be writable by all users so that their
  247. # profile directory may be created the first time they log on
  248. ;[profiles]
  249. ; comment = Users profiles
  250. ; path = /home/samba/profiles
  251. ; guest ok = no
  252. ; browseable = no
  253. ; create mask = 0600
  254. ; directory mask = 0700
  255.  
  256. [printers]
  257. comment = All Printers
  258. browseable = no
  259. path = /var/spool/samba
  260. printable = yes
  261. guest ok = no
  262. read only = yes
  263. create mask = 0700
  264.  
  265. # Windows clients look for this share name as a source of downloadable
  266. # printer drivers
  267. [print$]
  268. comment = Printer Drivers
  269. path = /var/lib/samba/printers
  270. browseable = yes
  271. read only = yes
  272. guest ok = no
  273. # Uncomment to allow remote administration of Windows print drivers.
  274. # You may need to replace 'lpadmin' with the name of the group your
  275. # admin users are members of.
  276. # Please note that you also need to set appropriate Unix permissions
  277. # to the drivers directory for these users to have write rights in it
  278. ; write list = root, @lpadmin
Advertisement
Add Comment
Please, Sign In to add comment