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