Advertisement
Guest User

Samba config file

a guest
Jul 19th, 2023
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.93 KB | Software | 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. # workgroup = WORKGROUP
  30. workgroup = RINGWORLD
  31. netbios name = ringworld
  32.  
  33. # The Sonos units try to use NT LM 0.12, so we need to support that.
  34. # Apparently (from the manpage) CORE is upgraded anyway.
  35. min protocol = NT1
  36. min protocol = NT1
  37.  
  38. # I believe the Sonos units may also require unix extensions
  39. # since we're getting
  40. #
  41. # call_trans2qfilepathinfo: TRANSACT2_QPATHINFO: level = 512
  42. #[2023/07/19 09:44:17.546978, 3] ../../source3/smbd/error.c:78(error_packet_set)
  43. # NT error packet at ../../source3/smbd/smb1_trans2.c(2084) cmd=50 (SMBtrans2) NT_STATUS_INVALID_LEVEL
  44. #
  45. unix extensions = yes
  46.  
  47. # Windows Internet Name Serving Support Section:
  48. # WINS Support - Tells the NMBD component of Samba to enable its WINS Server
  49. wins support = yes
  50. preferred master = yes
  51. lm announce = yes
  52.  
  53. # WINS Server - Tells the NMBD components of Samba to be a WINS Client
  54. # Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
  55. ; wins server = w.x.y.z
  56.  
  57. # This will prevent nmbd to search for NetBIOS names through DNS.
  58. dns proxy = no
  59.  
  60. #### Networking ####
  61.  
  62. # The specific set of interfaces / networks to bind to
  63. # This can be either the interface name or an IP address/netmask;
  64. # interface names are normally preferred
  65. interfaces = 192.168.15.3
  66.  
  67. # Only bind to the named interfaces and/or networks; you must use the
  68. # 'interfaces' option above to use this.
  69. # It is recommended that you enable this feature if your Samba machine is
  70. # not protected by a firewall or is a firewall itself. However, this
  71. # option cannot handle dynamic or non-broadcast interfaces correctly.
  72. bind interfaces only = yes
  73.  
  74.  
  75.  
  76. #### Debugging/Accounting ####
  77.  
  78. # This tells Samba to use a separate log file for each machine
  79. # that connects
  80. log file = /var/log/samba/log.%m
  81.  
  82. # log level = 3
  83. log level = 6
  84.  
  85. # Cap the size of the individual log files (in KiB).
  86. max log size = 1000
  87.  
  88. # If you want Samba to only log through syslog then set the following
  89. # parameter to 'yes'.
  90. # syslog only = no
  91.  
  92. # We want Samba to log a minimum amount of information to syslog. Everything
  93. # should go to /var/log/samba/log.{smbd,nmbd} instead. If you want to log
  94. # through syslog you should set the following parameter to something higher.
  95. syslog = 0
  96.  
  97. # Do something sensible when Samba crashes: mail the admin a backtrace
  98. panic action = /usr/share/samba/panic-action %d
  99.  
  100.  
  101. ####### Authentication #######
  102.  
  103. # Server role. Defines in which mode Samba will operate. Possible
  104. # values are "standalone server", "member server", "classic primary
  105. # domain controller", "classic backup domain controller", "active
  106. # directory domain controller".
  107. #
  108. # Most people will want "standalone sever" or "member server".
  109. # Running as "active directory domain controller" will require first
  110. # running "samba-tool domain provision" to wipe databases and create a
  111. # new domain.
  112. server role = standalone server
  113.  
  114. # I think this is needed for Sonos S1 support.
  115. # Based on https://www.spinics.net/lists/samba/msg177241.html
  116. ntlm auth = yes
  117.  
  118. # If you are using encrypted passwords, Samba will need to know what
  119. # password database type you are using.
  120. passdb backend = tdbsam
  121.  
  122. obey pam restrictions = yes
  123.  
  124. # This boolean parameter controls whether Samba attempts to sync the Unix
  125. # password with the SMB password when the encrypted SMB password in the
  126. # passdb is changed.
  127. unix password sync = yes
  128.  
  129. # For Unix password sync to work on a Debian GNU/Linux system, the following
  130. # parameters must be set (thanks to Ian Kahan <<kahan@informatik.tu-muenchen.de> for
  131. # sending the correct chat script for the passwd program in Debian Sarge).
  132. passwd program = /usr/bin/passwd %u
  133. passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
  134.  
  135. # This boolean controls whether PAM will be used for password changes
  136. # when requested by an SMB client instead of the program listed in
  137. # 'passwd program'. The default is 'no'.
  138. pam password change = yes
  139.  
  140. # This option controls how unsuccessful authentication attempts are mapped
  141. # to anonymous connections
  142. map to guest = bad user
  143.  
  144. ########## Domains ###########
  145.  
  146. #
  147. # The following settings only takes effect if 'server role = primary
  148. # classic domain controller', 'server role = backup domain controller'
  149. # or 'domain logons' is set
  150. #
  151.  
  152. # It specifies the location of the user's
  153. # profile directory from the client point of view) The following
  154. # required a [profiles] share to be setup on the samba server (see
  155. # below)
  156. ; logon path = \\%N\profiles\%U
  157. # Another common choice is storing the profile in the user's home directory
  158. # (this is Samba's default)
  159. # logon path = \\%N\%U\profile
  160.  
  161. # The following setting only takes effect if 'domain logons' is set
  162. # It specifies the location of a user's home directory (from the client
  163. # point of view)
  164. ; logon drive = H:
  165. # logon home = \\%N\%U
  166.  
  167. # The following setting only takes effect if 'domain logons' is set
  168. # It specifies the script to run during logon. The script must be stored
  169. # in the [netlogon] share
  170. # NOTE: Must be store in 'DOS' file format convention
  171. ; logon script = logon.cmd
  172.  
  173. # This allows Unix users to be created on the domain controller via the SAMR
  174. # RPC pipe. The example command creates a user account with a disabled Unix
  175. # password; please adapt to your needs
  176. ; add user script = /usr/sbin/adduser --quiet --disabled-password --gecos "" %u
  177.  
  178. # This allows machine accounts to be created on the domain controller via the
  179. # SAMR RPC pipe.
  180. # The following assumes a "machines" group exists on the system
  181. ; add machine script = /usr/sbin/useradd -g machines -c "%u machine account" -d /var/lib/samba -s /bin/false %u
  182.  
  183. # This allows Unix groups to be created on the domain controller via the SAMR
  184. # RPC pipe.
  185. ; add group script = /usr/sbin/addgroup --force-badname %g
  186.  
  187. ############ Misc ############
  188.  
  189. # Using the following line enables you to customise your configuration
  190. # on a per machine basis. The %m gets replaced with the netbios name
  191. # of the machine that is connecting
  192. ; include = /home/samba/etc/smb.conf.%m
  193.  
  194. # Some defaults for winbind (make sure you're not using the ranges
  195. # for something else.)
  196. ; idmap uid = 10000-20000
  197. ; idmap gid = 10000-20000
  198. ; template shell = /bin/bash
  199.  
  200. # Setup usershare options to enable non-root users to share folders
  201. # with the net usershare command.
  202.  
  203. # Maximum number of usershare. 0 (default) means that usershare is disabled.
  204. ; usershare max shares = 100
  205.  
  206. # Allow users who've been granted usershare privileges to create
  207. # public shares, not just authenticated ones
  208. usershare allow guests = yes
  209.  
  210. #======================= Share Definitions =======================
  211.  
  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 = no
  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. # The following parameter makes sure that only "username" can connect
  231. # to \\server\username
  232. # This might need tweaking when using external authentication schemes
  233. # valid users = %S
  234. valid users = myusername
  235.  
  236. # Un-comment the following and create the netlogon directory for Domain Logons
  237. # (you need to configure Samba to act as a domain controller too.)
  238. ;[netlogon]
  239. ; comment = Network Logon Service
  240. ; path = /home/samba/netlogon
  241. ; guest ok = yes
  242. ; read only = yes
  243.  
  244. # Un-comment the following and create the profiles directory to store
  245. # users profiles (see the "logon path" option above)
  246. # (you need to configure Samba to act as a domain controller too.)
  247. # The path below should be writable by all users so that their
  248. # profile directory may be created the first time they log on
  249. ;[profiles]
  250. ; comment = Users profiles
  251. ; path = /home/samba/profiles
  252. ; guest ok = no
  253. ; browseable = no
  254. ; create mask = 0600
  255. ; directory mask = 0700
  256.  
  257. [printers]
  258. comment = All Printers
  259. browseable = no
  260. path = /var/tmp
  261. printable = yes
  262. guest ok = no
  263. read only = yes
  264. create mask = 0700
  265.  
  266. # Windows clients look for this share name as a source of downloadable
  267. # printer drivers
  268. [print$]
  269. comment = Printer Drivers
  270. path = /var/lib/samba/printers
  271. browseable = yes
  272. read only = yes
  273. guest ok = no
  274. # Uncomment to allow remote administration of Windows print drivers.
  275. # You may need to replace 'lpadmin' with the name of the group your
  276. # admin users are members of.
  277. # Please note that you also need to set appropriate Unix permissions
  278. # to the drivers directory for these users to have write rights in it
  279. ; write list = root, @lpadmin
  280.  
  281.  
  282. [music]
  283. comment = Music files
  284. path = /nas/music
  285. browseable = yes
  286. read only = yes
  287. guest ok = yes
  288.  
  289. [books]
  290. comment = Books
  291. path = /nas/books
  292. browseable = yes
  293. read only = yes
  294. guest ok = yes
  295.  
  296. [photo]
  297. comment = Photographs
  298. path = /nas/photo
  299. browseable = yes
  300. read only = no
  301. guest ok = no
  302.  
  303.  
  304. [readonlyphoto]
  305. comment = Photographs
  306. path = /nas/photo
  307. browseable = yes
  308. read only = yes
  309. guest ok = yes
  310.  
  311.  
  312. [video]
  313. comment = Video Content: TV, movies
  314. path = /nas/video
  315. browseable = yes
  316. read only = yes
  317. guest ok = yes
  318.  
  319. [videoupdate]
  320. comment = Upadateable Video Content: TV, movies
  321. path = /nas/video
  322. browseable = yes
  323. read only = no
  324. guest ok = no
  325. valid users = sonarr, debian-transmission, sabnzbdplus
  326. create mask = 664
  327. force create mode = 664
  328. directory mask = 2775
  329. force directory mode = 2775
  330. inherit permissions = yes
  331.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement