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