The Samba Configuration File Format
Before delving into Samba
configuration, you should understand the Samba configuration file
format. This file is called
smb.conf
,
and it’s typically located in
/etc/samba
, although a few distributions
(particularly old ones) place it in some variant location, such as
/etc/samba.d
or /etc
. When
you compile from source code, it goes in
/usr/local/samba/lib
unless you change a
configuration option.
Wherever it’s located, the
smb.conf
file is broken into several distinct
sections, each of which has its purposes. Within each section, lines
have a simple structure consisting of a
parameter that’s to be set
and one or more values to be assigned to the
parameter, or they may be comment lines. You should also understand
the use of Samba variables, which enable you
to set a parameter to a value you may not know when creating the
configuration file.
Configuration File Sections
Example 3-1 shows a short but complete
smb.conf
configuration file. In this file, the
section names appear between square brackets ([ ]
). In this example, the section names are
[global]
, [homes]
, and
[freefiles]
.
Example 3-1. A short smb.conf file
[global] workgroup = GREENHOUSE netbios name = MANDRAKE server string = Free files for all encrypt passwords = Yes security = User os level = 2 domain master = No preferred master = No domain logons = No [homes] browseable = No writeable = Yes # Put all our public files in a logical place.... [freefiles] path = /usr/share/samba/public browseable ...
Get Linux in a Windows World now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.