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