|
|
3b29a2 |
# This is the main Samba configuration file. For detailed information about the
|
|
|
3b29a2 |
# options listed here, refer to the smb.conf(5) manual page. Samba has a huge
|
|
|
3b29a2 |
# number of configurable options, most of which are not shown in this example.
|
|
|
3b29a2 |
#
|
|
|
3b29a2 |
# The Samba Wiki contains a lot of step-by-step guides installing, configuring,
|
|
|
3b29a2 |
# and using Samba:
|
|
|
3b29a2 |
# https://wiki.samba.org/index.php/User_Documentation
|
|
|
3b29a2 |
#
|
|
|
3b29a2 |
# In this file, lines starting with a semicolon (;) or a hash (#) are
|
|
|
3b29a2 |
# comments and are ignored. This file uses hashes to denote commentary and
|
|
|
3b29a2 |
# semicolons for parts of the file you may wish to configure.
|
|
|
3b29a2 |
#
|
|
|
3b29a2 |
# NOTE: Run the "testparm" command after modifying this file to check for basic
|
|
|
3b29a2 |
# syntax errors.
|
|
|
3b29a2 |
#
|
|
|
3b29a2 |
#---------------
|
|
|
3b29a2 |
# Security-Enhanced Linux (SELinux) Notes:
|
|
|
3b29a2 |
#
|
|
|
3b29a2 |
# Turn the samba_domain_controller Boolean on to allow a Samba PDC to use the
|
|
|
3b29a2 |
# useradd and groupadd family of binaries. Run the following command as the
|
|
|
3b29a2 |
# root user to turn this Boolean on:
|
|
|
3b29a2 |
# setsebool -P samba_domain_controller on
|
|
|
3b29a2 |
#
|
|
|
3b29a2 |
# Turn the samba_enable_home_dirs Boolean on if you want to share home
|
|
|
3b29a2 |
# directories via Samba. Run the following command as the root user to turn this
|
|
|
3b29a2 |
# Boolean on:
|
|
|
3b29a2 |
# setsebool -P samba_enable_home_dirs on
|
|
|
3b29a2 |
#
|
|
|
3b29a2 |
# If you create a new directory, such as a new top-level directory, label it
|
|
|
3b29a2 |
# with samba_share_t so that SELinux allows Samba to read and write to it. Do
|
|
|
3b29a2 |
# not label system directories, such as /etc/ and /home/, with samba_share_t, as
|
|
|
3b29a2 |
# such directories should already have an SELinux label.
|
|
|
3b29a2 |
#
|
|
|
3b29a2 |
# Run the "ls -ldZ /path/to/directory" command to view the current SELinux
|
|
|
3b29a2 |
# label for a given directory.
|
|
|
3b29a2 |
#
|
|
|
3b29a2 |
# Set SELinux labels only on files and directories you have created. Use the
|
|
|
3b29a2 |
# chcon command to temporarily change a label:
|
|
|
3b29a2 |
# chcon -t samba_share_t /path/to/directory
|
|
|
3b29a2 |
#
|
|
|
3b29a2 |
# Changes made via chcon are lost when the file system is relabeled or commands
|
|
|
3b29a2 |
# such as restorecon are run.
|
|
|
3b29a2 |
#
|
|
|
3b29a2 |
# Use the samba_export_all_ro or samba_export_all_rw Boolean to share system
|
|
|
3b29a2 |
# directories. To share such directories and only allow read-only permissions:
|
|
|
3b29a2 |
# setsebool -P samba_export_all_ro on
|
|
|
3b29a2 |
# To share such directories and allow read and write permissions:
|
|
|
3b29a2 |
# setsebool -P samba_export_all_rw on
|
|
|
3b29a2 |
#
|
|
|
3b29a2 |
# To run scripts (preexec/root prexec/print command/...), copy them to the
|
|
|
3b29a2 |
# /var/lib/samba/scripts/ directory so that SELinux will allow smbd to run them.
|
|
|
3b29a2 |
# Note that if you move the scripts to /var/lib/samba/scripts/, they retain
|
|
|
3b29a2 |
# their existing SELinux labels, which may be labels that SELinux does not allow
|
|
|
3b29a2 |
# smbd to run. Copying the scripts will result in the correct SELinux labels.
|
|
|
3b29a2 |
# Run the "restorecon -R -v /var/lib/samba/scripts" command as the root user to
|
|
|
3b29a2 |
# apply the correct SELinux labels to these files.
|
|
|
3b29a2 |
#
|
|
|
3b29a2 |
#--------------
|
|
|
3b29a2 |
#
|
|
|
3b29a2 |
#======================= Global Settings =====================================
|
|
|
3b29a2 |
|
|
|
3b29a2 |
[global]
|
|
|
3b29a2 |
|
|
|
3b29a2 |
# ----------------------- Network-Related Options -------------------------
|
|
|
3b29a2 |
#
|
|
|
3b29a2 |
# workgroup = the Windows NT domain name or workgroup name, for example, MYGROUP.
|
|
|
3b29a2 |
#
|
|
|
3b29a2 |
# server string = the equivalent of the Windows NT Description field.
|
|
|
3b29a2 |
#
|
|
|
3b29a2 |
# netbios name = used to specify a server name that is not tied to the hostname,
|
|
|
3b29a2 |
# maximum is 15 characters.
|
|
|
3b29a2 |
#
|
|
|
3b29a2 |
# interfaces = used to configure Samba to listen on multiple network interfaces.
|
|
|
3b29a2 |
# If you have multiple interfaces, you can use the "interfaces =" option to
|
|
|
3b29a2 |
# configure which of those interfaces Samba listens on. Never omit the localhost
|
|
|
3b29a2 |
# interface (lo).
|
|
|
3b29a2 |
#
|
|
|
3b29a2 |
# hosts allow = the hosts allowed to connect. This option can also be used on a
|
|
|
3b29a2 |
# per-share basis.
|
|
|
3b29a2 |
#
|
|
|
3b29a2 |
# hosts deny = the hosts not allowed to connect. This option can also be used on
|
|
|
3b29a2 |
# a per-share basis.
|
|
|
3b29a2 |
#
|
|
|
3b29a2 |
workgroup = MYGROUP
|
|
|
3b29a2 |
server string = Samba Server Version %v
|
|
|
3b29a2 |
|
|
|
3b29a2 |
; netbios name = MYSERVER
|
|
|
3b29a2 |
|
|
|
3b29a2 |
; interfaces = lo eth0 192.168.12.2/24 192.168.13.2/24
|
|
|
3b29a2 |
; hosts allow = 127. 192.168.12. 192.168.13.
|
|
|
3b29a2 |
|
|
|
3b29a2 |
# --------------------------- Logging Options -----------------------------
|
|
|
3b29a2 |
#
|
|
|
3b29a2 |
# log file = specify where log files are written to and how they are split.
|
|
|
3b29a2 |
#
|
|
|
3b29a2 |
# max log size = specify the maximum size log files are allowed to reach. Log
|
|
|
3b29a2 |
# files are rotated when they reach the size specified with "max log size".
|
|
|
3b29a2 |
#
|
|
|
3b29a2 |
|
|
|
3b29a2 |
# log files split per-machine:
|
|
|
3b29a2 |
log file = /var/log/samba/log.%m
|
|
|
3b29a2 |
# maximum size of 50KB per log file, then rotate:
|
|
|
3b29a2 |
max log size = 50
|
|
|
3b29a2 |
|
|
|
3b29a2 |
# ----------------------- Standalone Server Options ------------------------
|
|
|
3b29a2 |
#
|
|
|
3b29a2 |
# security = the mode Samba runs in. This can be set to user, share
|
|
|
3b29a2 |
# (deprecated), or server (deprecated).
|
|
|
3b29a2 |
#
|
|
|
3b29a2 |
# passdb backend = the backend used to store user information in. New
|
|
|
3b29a2 |
# installations should use either tdbsam or ldapsam. No additional configuration
|
|
|
3b29a2 |
# is required for tdbsam. The "smbpasswd" utility is available for backwards
|
|
|
3b29a2 |
# compatibility.
|
|
|
3b29a2 |
#
|
|
|
3b29a2 |
|
|
|
3b29a2 |
security = user
|
|
|
3b29a2 |
passdb backend = tdbsam
|
|
|
3b29a2 |
|
|
|
3b29a2 |
|
|
|
3b29a2 |
# ----------------------- Domain Members Options ------------------------
|
|
|
3b29a2 |
#
|
|
|
3b29a2 |
# security = must be set to domain or ads.
|
|
|
3b29a2 |
#
|
|
|
3b29a2 |
# passdb backend = the backend used to store user information in. New
|
|
|
3b29a2 |
# installations should use either tdbsam or ldapsam. No additional configuration
|
|
|
3b29a2 |
# is required for tdbsam. The "smbpasswd" utility is available for backwards
|
|
|
3b29a2 |
# compatibility.
|
|
|
3b29a2 |
#
|
|
|
3b29a2 |
# realm = only use the realm option when the "security = ads" option is set.
|
|
|
3b29a2 |
# The realm option specifies the Active Directory realm the host is a part of.
|
|
|
3b29a2 |
#
|
|
|
3b29a2 |
# password server = only use this option when the "security = server"
|
|
|
3b29a2 |
# option is set, or if you cannot use DNS to locate a Domain Controller. The
|
|
|
3b29a2 |
# argument list can include My_PDC_Name, [My_BDC_Name], and [My_Next_BDC_Name]:
|
|
|
3b29a2 |
#
|
|
|
3b29a2 |
# password server = My_PDC_Name [My_BDC_Name] [My_Next_BDC_Name]
|
|
|
3b29a2 |
#
|
|
|
3b29a2 |
# Use "password server = *" to automatically locate Domain Controllers.
|
|
|
3b29a2 |
|
|
|
3b29a2 |
; security = domain
|
|
|
3b29a2 |
; passdb backend = tdbsam
|
|
|
3b29a2 |
; realm = MY_REALM
|
|
|
3b29a2 |
|
|
|
3b29a2 |
; password server = <NT-Server-Name>
|
|
|
3b29a2 |
|
|
|
3b29a2 |
# ----------------------- Domain Controller Options ------------------------
|
|
|
3b29a2 |
#
|
|
|
3b29a2 |
# security = must be set to user for domain controllers.
|
|
|
3b29a2 |
#
|
|
|
3b29a2 |
# passdb backend = the backend used to store user information in. New
|
|
|
3b29a2 |
# installations should use either tdbsam or ldapsam. No additional configuration
|
|
|
3b29a2 |
# is required for tdbsam. The "smbpasswd" utility is available for backwards
|
|
|
3b29a2 |
# compatibility.
|
|
|
3b29a2 |
#
|
|
|
3b29a2 |
# domain master = specifies Samba to be the Domain Master Browser, allowing
|
|
|
3b29a2 |
# Samba to collate browse lists between subnets. Do not use the "domain master"
|
|
|
3b29a2 |
# option if you already have a Windows NT domain controller performing this task.
|
|
|
3b29a2 |
#
|
|
|
3b29a2 |
# domain logons = allows Samba to provide a network logon service for Windows
|
|
|
3b29a2 |
# workstations.
|
|
|
3b29a2 |
#
|
|
|
3b29a2 |
# logon script = specifies a script to run at login time on the client. These
|
|
|
3b29a2 |
# scripts must be provided in a share named NETLOGON.
|
|
|
3b29a2 |
#
|
|
|
3b29a2 |
# logon path = specifies (with a UNC path) where user profiles are stored.
|
|
|
3b29a2 |
#
|
|
|
3b29a2 |
#
|
|
|
3b29a2 |
; security = user
|
|
|
3b29a2 |
; passdb backend = tdbsam
|
|
|
3b29a2 |
|
|
|
3b29a2 |
; domain master = yes
|
|
|
3b29a2 |
; domain logons = yes
|
|
|
3b29a2 |
|
|
|
3b29a2 |
# the following login script name is determined by the machine name
|
|
|
3b29a2 |
# (%m):
|
|
|
3b29a2 |
; logon script = %m.bat
|
|
|
3b29a2 |
# the following login script name is determined by the UNIX user used:
|
|
|
3b29a2 |
; logon script = %u.bat
|
|
|
3b29a2 |
; logon path = \\%L\Profiles\%u
|
|
|
3b29a2 |
# use an empty path to disable profile support:
|
|
|
3b29a2 |
; logon path =
|
|
|
3b29a2 |
|
|
|
3b29a2 |
# various scripts can be used on a domain controller or a stand-alone
|
|
|
3b29a2 |
# machine to add or delete corresponding UNIX accounts:
|
|
|
3b29a2 |
|
|
|
3b29a2 |
; add user script = /usr/sbin/useradd "%u" -n -g users
|
|
|
3b29a2 |
; add group script = /usr/sbin/groupadd "%g"
|
|
|
3b29a2 |
; add machine script = /usr/sbin/useradd -n -c "Workstation (%u)" -M -d /nohome -s /bin/false "%u"
|
|
|
3b29a2 |
; delete user script = /usr/sbin/userdel "%u"
|
|
|
3b29a2 |
; delete user from group script = /usr/sbin/userdel "%u" "%g"
|
|
|
3b29a2 |
; delete group script = /usr/sbin/groupdel "%g"
|
|
|
3b29a2 |
|
|
|
3b29a2 |
|
|
|
3b29a2 |
# ----------------------- Browser Control Options ----------------------------
|
|
|
3b29a2 |
#
|
|
|
3b29a2 |
# local master = when set to no, Samba does not become the master browser on
|
|
|
3b29a2 |
# your network. When set to yes, normal election rules apply.
|
|
|
3b29a2 |
#
|
|
|
3b29a2 |
# os level = determines the precedence the server has in master browser
|
|
|
3b29a2 |
# elections. The default value should be reasonable.
|
|
|
3b29a2 |
#
|
|
|
3b29a2 |
# preferred master = when set to yes, Samba forces a local browser election at
|
|
|
3b29a2 |
# start up (and gives itself a slightly higher chance of winning the election).
|
|
|
3b29a2 |
#
|
|
|
3b29a2 |
; local master = no
|
|
|
3b29a2 |
; os level = 33
|
|
|
3b29a2 |
; preferred master = yes
|
|
|
3b29a2 |
|
|
|
3b29a2 |
#----------------------------- Name Resolution -------------------------------
|
|
|
3b29a2 |
#
|
|
|
3b29a2 |
# This section details the support for the Windows Internet Name Service (WINS).
|
|
|
3b29a2 |
#
|
|
|
3b29a2 |
# Note: Samba can be either a WINS server or a WINS client, but not both.
|
|
|
3b29a2 |
#
|
|
|
3b29a2 |
# wins support = when set to yes, the NMBD component of Samba enables its WINS
|
|
|
3b29a2 |
# server.
|
|
|
3b29a2 |
#
|
|
|
3b29a2 |
# wins server = tells the NMBD component of Samba to be a WINS client.
|
|
|
3b29a2 |
#
|
|
|
3b29a2 |
# wins proxy = when set to yes, Samba answers name resolution queries on behalf
|
|
|
3b29a2 |
# of a non WINS capable client. For this to work, there must be at least one
|
|
|
3b29a2 |
# WINS server on the network. The default is no.
|
|
|
3b29a2 |
#
|
|
|
3b29a2 |
# dns proxy = when set to yes, Samba attempts to resolve NetBIOS names via DNS
|
|
|
3b29a2 |
# nslookups.
|
|
|
3b29a2 |
|
|
|
3b29a2 |
; wins support = yes
|
|
|
3b29a2 |
; wins server = w.x.y.z
|
|
|
3b29a2 |
; wins proxy = yes
|
|
|
3b29a2 |
|
|
|
3b29a2 |
; dns proxy = yes
|
|
|
3b29a2 |
|
|
|
3b29a2 |
# --------------------------- Printing Options -----------------------------
|
|
|
3b29a2 |
#
|
|
|
3b29a2 |
# The options in this section allow you to configure a non-default printing
|
|
|
3b29a2 |
# system.
|
|
|
3b29a2 |
#
|
|
|
3b29a2 |
# load printers = when set you yes, the list of printers is automatically
|
|
|
3b29a2 |
# loaded, rather than setting them up individually.
|
|
|
3b29a2 |
#
|
|
|
3b29a2 |
# cups options = allows you to pass options to the CUPS library. Setting this
|
|
|
3b29a2 |
# option to raw, for example, allows you to use drivers on your Windows clients.
|
|
|
3b29a2 |
#
|
|
|
3b29a2 |
# printcap name = used to specify an alternative printcap file.
|
|
|
3b29a2 |
#
|
|
|
3b29a2 |
|
|
|
3b29a2 |
load printers = yes
|
|
|
3b29a2 |
cups options = raw
|
|
|
3b29a2 |
|
|
|
3b29a2 |
; printcap name = /etc/printcap
|
|
|
3b29a2 |
# obtain a list of printers automatically on UNIX System V systems:
|
|
|
3b29a2 |
; printcap name = lpstat
|
|
|
3b29a2 |
; printing = cups
|
|
|
3b29a2 |
|
|
|
3b29a2 |
# --------------------------- File System Options ---------------------------
|
|
|
3b29a2 |
#
|
|
|
3b29a2 |
# The options in this section can be un-commented if the file system supports
|
|
|
3b29a2 |
# extended attributes, and those attributes are enabled (usually via the
|
|
|
3b29a2 |
# "user_xattr" mount option). These options allow the administrator to specify
|
|
|
3b29a2 |
# that DOS attributes are stored in extended attributes and also make sure that
|
|
|
3b29a2 |
# Samba does not change the permission bits.
|
|
|
3b29a2 |
#
|
|
|
3b29a2 |
# Note: These options can be used on a per-share basis. Setting them globally
|
|
|
3b29a2 |
# (in the [global] section) makes them the default for all shares.
|
|
|
3b29a2 |
|
|
|
3b29a2 |
; map archive = no
|
|
|
3b29a2 |
; map hidden = no
|
|
|
3b29a2 |
; map read only = no
|
|
|
3b29a2 |
; map system = no
|
|
|
3b29a2 |
; store dos attributes = yes
|
|
|
3b29a2 |
|
|
|
3b29a2 |
|
|
|
3b29a2 |
#============================ Share Definitions ==============================
|
|
|
3b29a2 |
|
|
|
3b29a2 |
[homes]
|
|
|
3b29a2 |
comment = Home Directories
|
|
|
3b29a2 |
browseable = no
|
|
|
3b29a2 |
writable = yes
|
|
|
3b29a2 |
; valid users = %S
|
|
|
3b29a2 |
; valid users = MYDOMAIN\%S
|
|
|
3b29a2 |
|
|
|
3b29a2 |
[printers]
|
|
|
3b29a2 |
comment = All Printers
|
|
|
a2e190 |
path = /var/tmp
|
|
|
3b29a2 |
browseable = no
|
|
|
3b29a2 |
guest ok = no
|
|
|
3b29a2 |
writable = no
|
|
|
3b29a2 |
printable = yes
|
|
|
3b29a2 |
|
|
|
3b29a2 |
# Un-comment the following and create the netlogon directory for Domain Logons:
|
|
|
3b29a2 |
; [netlogon]
|
|
|
3b29a2 |
; comment = Network Logon Service
|
|
|
3b29a2 |
; path = /var/lib/samba/netlogon
|
|
|
3b29a2 |
; guest ok = yes
|
|
|
3b29a2 |
; writable = no
|
|
|
3b29a2 |
; share modes = no
|
|
|
3b29a2 |
|
|
|
3b29a2 |
# Un-comment the following to provide a specific roaming profile share.
|
|
|
3b29a2 |
# The default is to use the user's home directory:
|
|
|
3b29a2 |
; [Profiles]
|
|
|
3b29a2 |
; path = /var/lib/samba/profiles
|
|
|
3b29a2 |
; browseable = no
|
|
|
3b29a2 |
; guest ok = yes
|
|
|
3b29a2 |
|
|
|
3b29a2 |
# A publicly accessible directory that is read only, except for users in the
|
|
|
3b29a2 |
# "staff" group (which have write permissions):
|
|
|
3b29a2 |
; [public]
|
|
|
3b29a2 |
; comment = Public Stuff
|
|
|
3b29a2 |
; path = /home/samba
|
|
|
3b29a2 |
; public = yes
|
|
|
3b29a2 |
; writable = no
|
|
|
3b29a2 |
; printable = no
|
|
|
3b29a2 |
; write list = +staff
|