SHARE
TWEET

Untitled

a guest Jun 19th, 2017 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. # A well-established practice is to name the original file
  22. # "smb.conf.master" and create the "real" config file with
  23. # testparm -s smb.conf.master >smb.conf
  24. # This minimizes the size of the really used smb.conf file
  25. # which, according to the Samba Team, impacts performance
  26. # However, use this with caution if your smb.conf file contains nested
  27. # "include" statements. See Debian bug #483187 for a case
  28. # where using a master file is not a good idea.
  29. #
  30.  
  31. #======================= Global Settings =======================
  32.  
  33. [global]
  34.  
  35. ## Browsing/Identification ###
  36.  
  37. # Change this to the workgroup/NT-domain name your Samba server will part of
  38.    workgroup = HOME
  39.  
  40. # server string is the equivalent of the NT Description field
  41.    server string = %h
  42.  
  43. # Windows Internet Name Serving Support Section:
  44. # WINS Support - Tells the NMBD component of Samba to enable its WINS Server
  45.    wins support = yes
  46.  
  47. # WINS Server - Tells the NMBD components of Samba to be a WINS Client
  48. # Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
  49. ;   wins server = w.x.y.z
  50.  
  51. # This will prevent nmbd to search for NetBIOS names through DNS.
  52.    dns proxy = no
  53.  
  54. # What naming service and in what order should we use to resolve host names
  55. # to IP addresses
  56. ;   name resolve order = lmhosts host wins bcast
  57.  
  58. #### Networking ####
  59.  
  60. # The specific set of interfaces / networks to bind to
  61. # This can be either the interface name or an IP address/netmask;
  62. # interface names are normally preferred
  63.    interfaces = 192.168.1.16/24 eth3
  64.  
  65. # Only bind to the named interfaces and/or networks; you must use the
  66. # 'interfaces' option above to use this.
  67. # It is recommended that you enable this feature if your Samba machine is
  68. # not protected by a firewall or is a firewall itself.  However, this
  69. # option cannot handle dynamic or non-broadcast interfaces correctly.
  70.    bind interfaces only = yes
  71.  
  72.  
  73.  
  74. #### Debugging/Accounting ####
  75.  
  76. # This tells Samba to use a separate log file for each machine
  77. # that connects
  78.    log file = /var/log/samba/log.%m
  79.  
  80. # Cap the size of the individual log files (in KiB).
  81.    max log size = 1000
  82.  
  83. # If you want Samba to only log through syslog then set the following
  84. # parameter to 'yes'.
  85. #   syslog only = no
  86.  
  87. # We want Samba to log a minimum amount of information to syslog. Everything
  88. # should go to /var/log/samba/log.{smbd,nmbd} instead. If you want to log
  89. # through syslog you should set the following parameter to something higher.
  90.    syslog = 0
  91.  
  92. # Do something sensible when Samba crashes: mail the admin a backtrace
  93.    panic action = /usr/share/samba/panic-action %d
  94.  
  95.  
  96. ####### Authentication #######
  97.  
  98. # "security = user" is always a good idea. This will require a Unix account
  99. # in this server for every user accessing the server. See
  100. # /usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/ServerType.html
  101. # in the samba-doc package for details.
  102.    security = user
  103.  
  104. # You may wish to use password encryption.  See the section on
  105. # 'encrypt passwords' in the smb.conf(5) manpage before enabling.
  106.    encrypt passwords = true
  107.  
  108. # If you are using encrypted passwords, Samba will need to know what
  109. # password database type you are using.  
  110.    passdb backend = ldapsam:ldap://localhost/
  111.    obey pam restrictions = no
  112.  
  113.  
  114.  
  115.  
  116.     ldap admin dn = cn=admin,dc=home
  117.     ldap suffix = dc=HOME
  118.     ldap group suffix = ou=Groups
  119.     ldap user suffix = ou=Users
  120.     ldap machine suffix = ou=Computers
  121.     ldap idmap suffix = ou=Users
  122.  
  123.  
  124.  
  125. # This boolean parameter controls whether Samba attempts to sync the Unix
  126. # password with the SMB password when the encrypted SMB password in the
  127. # passdb is changed.
  128.     unix password sync = yes
  129.     ldap passwd sync = Yes
  130.     ldap delete dn = Yes
  131.  
  132.  
  133. # For Unix password sync to work on a Debian GNU/Linux system, the following
  134. # parameters must be set (thanks to Ian Kahan <<kahan@informatik.tu-muenchen.de> for
  135. # sending the correct chat script for the passwd program in Debian Sarge).
  136. ;   passwd program = /usr/bin/passwd %u
  137.  
  138.     passwd program = /usr/sbin/smbldap-passwd %u
  139.  
  140.     passwd chat = *New*password* %n\n *Retype*new*password* %n\n *all*authentication*tokens*updated*
  141.  
  142.  
  143. ;passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
  144.  
  145. # This boolean controls whether PAM will be used for password changes
  146. # when requested by an SMB client instead of the program listed in
  147. # 'passwd program'. The default is 'no'.
  148.    pam password change = yes
  149.  
  150. ########## Domains ###########
  151.  
  152. # Is this machine able to authenticate users. Both PDC and BDC
  153. # must have this setting enabled. If you are the BDC you must
  154. # change the 'domain master' setting to no
  155. #
  156.    domain logons = yes
  157. #
  158. # The following setting only takes effect if 'domain logons' is set
  159. # It specifies the location of the user's profile directory
  160. # from the client point of view)
  161. # The following required a [profiles] share to be setup on the
  162. # samba server (see below)
  163. ;   logon path = \\%N\profiles\%U
  164. ;   logon path =
  165. # Another common choice is storing the profile in the user's home directory
  166. # (this is Samba's default)
  167. #   logon path = \\%N\%U\profile
  168.     logon path = \\%N\profiles\%U\%a
  169.  
  170. # The following setting only takes effect if 'domain logons' is set
  171. # It specifies the location of a user's home directory (from the client
  172. # point of view)
  173.    logon drive = Z:
  174. #   logon home = \\%N\%U
  175.  
  176. # The following setting only takes effect if 'domain logons' is set
  177. # It specifies the script to run during logon. The script must be stored
  178. # in the [netlogon] share
  179. # NOTE: Must be store in 'DOS' file format convention
  180. ;   logon script = logon.cmd
  181.  
  182. # This allows Unix users to be created on the domain controller via the SAMR
  183. # RPC pipe.  The example command creates a user account with a disabled Unix
  184. # password; please adapt to your needs
  185. ; add user script = /usr/sbin/adduser --quiet --disabled-password --gecos "" %u
  186.  
  187.  
  188.  
  189.     add user script = /usr/sbin/smbldap-useradd -m "%u"
  190.     delete user script = /usr/sbin/smbldap-userdel "%u"
  191.  
  192.  
  193.  
  194.  
  195.  
  196. # This allows machine accounts to be created on the domain controller via the
  197. # SAMR RPC pipe.  
  198. # The following assumes a "machines" group exists on the system
  199. ; add machine script  = /usr/sbin/useradd -g machines -c "%u machine account" -d /var/lib/samba -s /bin/false %u
  200.  
  201.  
  202.  
  203.     add machine script = /usr/sbin/smbldap-useradd -w "%u"
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210. # This allows Unix groups to be created on the domain controller via the SAMR
  211. # RPC pipe.  
  212. ; add group script = /usr/sbin/addgroup --force-badname %g
  213.  
  214.  
  215.  
  216.     add group script = /usr/sbin/smbldap-groupadd -p "%g"
  217.     delete group script = /usr/sbin/smbldap-groupdel "%g"
  218.     add user to group script = /usr/sbin/smbldap-groupmod -m "%u" "%g"
  219.     delete user from group script = /usr/sbin/smbldap-groupmod -x "%u" "%g"
  220.     set primary group script = /usr/sbin/smbldap-usermod -g "%g" "%u"
  221.  
  222. ########## Printing ##########
  223.  
  224. # If you want to automatically load your printer list rather
  225. # than setting them up individually then you'll need this
  226. #   load printers = yes
  227.  
  228. # lpr(ng) printing. You may wish to override the location of the
  229. # printcap file
  230. ;   printing = bsd
  231. ;   printcap name = /etc/printcap
  232.  
  233. # CUPS printing.  See also the cupsaddsmb(8) manpage in the
  234. # cupsys-client package.
  235. ;   printing = cups
  236. ;   printcap name = cups
  237.  
  238. ############ Misc ############
  239.  
  240. # Using the following line enables you to customise your configuration
  241. # on a per machine basis. The %m gets replaced with the netbios name
  242. # of the machine that is connecting
  243. ;   include = /home/samba/etc/smb.conf.%m
  244.  
  245. # Most people will find that this option gives better performance.
  246. # See smb.conf(5) and /usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/speed.html
  247. # for details
  248. # You may want to add the following on a Linux system:
  249. #         SO_RCVBUF=8192 SO_SNDBUF=8192
  250. #   socket options = TCP_NODELAY
  251.  
  252. # The following parameter is useful only if you have the linpopup package
  253. # installed. The samba maintainer and the linpopup maintainer are
  254. # working to ease installation and configuration of linpopup and samba.
  255. ;   message command = /bin/sh -c '/usr/bin/linpopup "%f" "%m" %s; rm %s' &
  256.  
  257. # Domain Master specifies Samba to be the Domain Master Browser. If this
  258. # machine will be configured as a BDC (a secondary logon server), you
  259. # must set this to 'no'; otherwise, the default behavior is recommended.
  260. #   domain master = auto
  261.  
  262. # Some defaults for winbind (make sure you're not using the ranges
  263. # for something else.)
  264. ;   idmap uid = 10000-20000
  265. ;   idmap gid = 10000-20000
  266. ;   template shell = /bin/bash
  267.  
  268. # The following was the default behaviour in sarge,
  269. # but samba upstream reverted the default because it might induce
  270. # performance issues in large organizations.
  271. # See Debian bug #368251 for some of the consequences of *not*
  272. # having this setting and smb.conf(5) for details.
  273. ;   winbind enum groups = yes
  274. ;   winbind enum users = yes
  275.  
  276. # Setup usershare options to enable non-root users to share folders
  277. # with the net usershare command.
  278.  
  279. # Maximum number of usershare. 0 (default) means that usershare is disabled.
  280. ;   usershare max shares = 100
  281.  
  282. #======================= Share Definitions =======================
  283.  
  284. [homes]
  285.    comment = Home Directories
  286.    browseable = no
  287.  
  288. # By default, the home directories are exported read-only. Change the
  289. # next parameter to 'no' if you want to be able to write to them.
  290.    read only = no
  291.  
  292. # File creation mask is set to 0700 for security reasons. If you want to
  293. # create files with group=rw permissions, set next parameter to 0775.
  294.    create mask = 0700
  295.  
  296. # Directory creation mask is set to 0700 for security reasons. If you want to
  297. # create dirs. with group=rw permissions, set next parameter to 0775.
  298.    directory mask = 0700
  299.  
  300. # By default, \\server\username shares can be connected to by anyone
  301. # with access to the samba server.
  302. # The following parameter makes sure that only "username" can connect
  303. # to \\server\username
  304. # This might need tweaking when using external authentication schemes
  305.    valid users = %S
  306.    hide dot file= yes
  307. # Un-comment the following and create the netlogon directory for Domain Logons
  308. # (you need to configure Samba to act as a domain controller too.)
  309. [netlogon]
  310.     guest ok = yes
  311.     force create mode = 755
  312.     comment = Network Logon Service
  313.     writable = no
  314.     share modes = no
  315.     path = /home/samba/netlogon
  316.     force directory mode = 755
  317.  
  318. # Un-comment the following and create the profiles directory to store
  319. # users profiles (see the "logon path" option above)
  320. # (you need to configure Samba to act as a domain controller too.)
  321. # The path below should be writable by all users so that their
  322. # profile directory may be created the first time they log on
  323.  
  324. [profiles]
  325.    comment = Users profiles
  326.    path = /home/samba/profiles
  327.    guest ok = no
  328.    
  329.    create mask = 0700
  330.    directory mask = 0700
  331.  
  332. [printers]
  333.    comment = All Printers
  334.    browseable = no
  335.    path = /var/spool/samba
  336.    printable = yes
  337.    guest ok = no
  338.    read only = yes
  339.    create mask = 0755
  340.  
  341. # Windows clients look for this share name as a source of downloadable
  342. # printer drivers
  343. [print$]
  344.    comment = Printer Drivers
  345.    path = /var/lib/samba/printers
  346.    browseable = yes
  347.    read only = yes
  348.    guest ok = no
  349. # Uncomment to allow remote administration of Windows print drivers.
  350. # You may need to replace 'lpadmin' with the name of the group your
  351. # admin users are members of.
  352. # Please note that you also need to set appropriate Unix permissions
  353. # to the drivers directory for these users to have write rights in it
  354.    write list = root, @sudo
  355.  
  356. # A sample share for sharing your CD-ROM with others.
  357. ;[cdrom]
  358. ;   comment = Samba server's CD-ROM
  359. ;   read only = yes
  360. ;   locking = no
  361. ;   path = /cdrom
  362. ;   guest ok = yes
  363.  
  364. # The next two parameters show how to auto-mount a CD-ROM when the
  365. #   cdrom share is accesed. For this to work /etc/fstab must contain
  366. #   an entry like this:
  367. #
  368. #       /dev/scd0   /cdrom  iso9660 defaults,noauto,ro,user   0 0
  369. #
  370. # The CD-ROM gets unmounted automatically after the connection to the
  371. #
  372. # If you don't want to use auto-mounting/unmounting make sure the CD
  373. #   is mounted on /cdrom
  374. #
  375. ;   preexec = /bin/mount /cdrom
  376. ;   postexec = /bin/umount /cdrom
  377.  
  378.  
  379. [www]
  380.     comment = Webserver Document Root
  381.     force user = root
  382.     guest ok = no
  383.     valid users = @sudo
  384.     create mask = 775
  385.     path = /var/www
RAW Paste Data
Pastebin PRO Summer Special!
Get 40% OFF on Pastebin PRO accounts!
Top