Samba is configured through settings that are stored in a text-format configuration file, which is located in the file /etc/samba/smb.conf on your SUSE system. The huge number of settings available in this file provides an interesting demonstration of the flexibility and power of the Samba software suite.
The Samba software suite provides excellent documentation about configuring and using every aspect of Samba. In addition, a number of excellent books are available on Samba and Samba 3 at your favorite brick-and-mortar or online bookstore. One of the best online general resources for Samba is its HOWTO collection, which is actually a single integrated document culled from many different sources by the Samba team. This document is installed as part of the samba-doc package on your SUSE system, and is also available online at many locations, including www.samba.org/samba/docs/man/Samba-HOWTO-Collection/ from the master Samba web site.
The Samba HOWTO Collection for Samba 3 provides over 45 examples of Samba configuration files, showing how to configure Samba for scenarios ranging from an anonymous print server to a full-blown SMB server that functions as a primary domain controller. Rather than rehashing existing documentation, this section provides an overview of the format and main sections available in a Samba configuration file.
A standard Samba configuration file is divided into a number of primary sections, each delimited by the name of that section enclosed within square brackets. The only mandatory section of a Samba configuration file is the [global] section, which sets values for the Samba server itself, such as the name of the workgroup or domain that the Samba server exports (if it is a PDC) or belongs to (if it is not a PDC). Other than this section, the smb.conf file can contain any number of other sections, each of which describes the attributes of a shared resource that is exported by your Samba server. The sections and associated resources in the default smb.conf file provided with SUSE Linux are as follows:
■ [global] General configuration settings, such as authentication and domain/workgroup information, that apply to all subsequent portions of the smb.conf file. As mentioned in the preceding paragraph, your smb.conf file must contain a [global] section, which is customized to reflect how your Samba server interacts with your local Windows domain or workgroup.
■ [groups] Configuration settings for a summary share that exports directories that are owned and writable by Linux groups.
■ [homes] Configuration settings for user home directories as exported by the Samba server.
■ [pdf] Configuration settings for a PDF file generator that is provided as a default printer in Samba.
■ [print$] Configuration settings for a general share that is intended to hold print drivers that Windows users can use to print to Windows printers via Samba.
■ [printers] Configuration settings for printers that are available via Samba.
■ [users] Configuration settings for a summary share that exports all Linux user home directories.
Whenever you add a new shared resource using the dialog box shown in Figure 18-9, a new section is created in smb.conf for that new resource.
The SUSE Administration Guide provides examples of additional resources that you may want to define and discusses the configuration settings that you should use to manage access to those resources.
i- ■ i- , If you manually modify your Samba configuration file, Samba includes a useful utility
,-W n '■■■' ■■i'1 called testparm that reads and parses a Samba configuration file and identifies any syntax errors that are present. You should always use this utility after making changes to your smb.conf file but before restarting your Samba server to ensure that the file itself is correct before trying to diagnose problems with the values that you specified.
Was this article helpful?