Advertisement
Guest User

Untitled

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