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