Advertisement
Guest User

Untitled

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