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