configuration-templates – Rev 93

Subversion Repositories:
Rev:
###########################################################################
##  Copyright (C) Wizardry and Steamworks 2017 - License: GNU GPLv3      ##
##  Please see: http://www.gnu.org/licenses/gpl.html for legal details,  ##
##  rights of fair usage, the disclaimer and warranty conditions.        ##
###########################################################################
## Optimized standalone configuration template for Samba servers.        ##
##                                                                       ##
## Ideal for:                                                            ##
##   * Virtual machine file sharing                                      ##
##                                                                       ##
## Requirements:                                                         ##
##   * Samba 4.x                                                         ##
##   * PAM Samba Password Module (Debian: libpam-smbpass)                ##
##                                                                       ##
## File placement layout:                                                ##
##  /                                                                    ##
##  `-- etc                                                              ##
##     `-- samba                                                         ##
##         |-- smb.conf                                                  ##
##         |-- smb.conf.local                                            ##
##         `-- smb.conf.share                                            ##
##                                                                       ##
## Files Description:                                                    ##
##   * /etc/samba/smb.conf (this file)                                   ##
##   * /etc/samba/smb.conf.local (local server-site settings)            ##
##   * /etc/samba/smb.conf.share (samba shares go here)                  ##
##                                                                       ##
###########################################################################

[global]
    bind interfaces only = yes
    name resolve order = lmhosts host wins bcast

    # Standalone.
    preferred master = yes
    security = user
    # Without authentication, shares are not visible.
    browseable = no
    public = no
    guest ok = no
    # For compatibility with scripts.
    passdb backend = smbpasswd
    map to guest = Bad Password
    # For compatibility with clients.
    client use spnego = no
    client ntlmv2 auth = no

    # Samba modules.
    vfs objects = catia fruit streams_xattr aio_linux 
    # Better compatibility with OSX.
    ea support = yes
    fruit:aapl = yes
    fruit:encoding = native
    fruit:locking = none
    fruit:metadata = stream
    fruit:resource = file
    aio_linux:aio num events = 256

    ### Tweaks
    # Don't tweak Linux buffers: SO_RCVBUF=131072 SO_SNDBUF=131072
    socket options=TCP_NODELAY IPTOS_THROUGHPUT SO_KEEPALIVE SO_BROADCAST
    use sendfile = true
    max open files = 65535
    min receivefile size = 131072
    # Requires aio_linux as last module in vfs_objects
    aio read size = 16384
    aio write size = 16384
    write cache size = 262144
    read raw = yes
    write raw = yes
    # Close connection on idle time (minutes).
    # deadtime = 15
    kernel oplocks = yes
    server multi channel support = yes
    
    # Logging
    # 0 -> LOG_ERR, 1 -> LOG_WARNING, 2 -> LOG_NOTICE, 3 -> LOG_DEBUG
    logging = syslog@3

    # Include local settings.
    include = /etc/samba/smb.conf.local

    # Include shares.
    include = /etc/samba/smb.conf.share