configuration-templates – Rev 63

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 3.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
    dns proxy = yes
    name resolve order = lmhosts host wins bcast

    # Standalone.
    local master = yes
    preferred master = yes
    security = user
    usershare allow guests = no
    # For compatibility with scripts.
    passdb backend = smbpasswd
    encrypt passwords = true
    map to guest = bad user

    # For password synchronization:
    # Debian:
    # 1.) Install libpam-smbpass
    # 2.) cp /usr/share/doc/libpam-smbpass/examples/password-sync to /etc/pam.d/
    obey pam restrictions = yes
    unix password sync = yes
    pam password change = yes
    passwd program = /usr/bin/passwd %u
    passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
    
    # Allow only NTMLv2 Auth for Compatibility with Windows 7+
    ntlm auth = no
    lanman auth = no

    # Better compatibility with OSX.
    unix extensions = no

    # Safe Tweaks
    socket options=SO_RCVBUF=131072 SO_SNDBUF=131072 TCP_NODELAY IPTOS_LOWDELAY
    use sendfile = true
    max xmit = 65535
    max connections = 65535
    max open files = 65535
    min receivefile size = 16384
    aio read size = 16384
    aio write size = 16384
    read raw = yes
    write raw = yes
    getwd cache = yes
    dead time = 15
    kernel oplocks = yes
    server multi channel support = yes
    
    # Logging
    log file = /var/log/samba4/log.%m
    max log size = 1000
    syslog = 0

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

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