Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Samba HowTo Guide
Prev Home Next

Configuration File Syntax

The smb.conf file uses the same syntax as the various old .ini files in Windows 3.1: Each file consists of various sections, which are started by putting the section name between brackets ([]) on a new line. Each contains zero or more key/value pairs separated by an equality sign (=). The file is just a plaintext file, so you can open and edit it with your favorite editing tool.

Each section in the smb.conf file represents either a share or a meta-service on the Samba server. The section [global] is special, since it contains settings that apply to the whole Samba server. Samba supports a number of meta-services, each of which serves its own purpose. For example, the [homes] share is a meta-service that causes Samba to provide a personal home share for each user. The [printers] share is a meta-service that establishes print queue support and that specifies the location of the intermediate spool directory into which print jobs are received from Windows clients prior to being dispatched to the UNIX/Linux print spooler.

The printers meta-service will cause every printer that is either specified in a printcap file, via the lpstat , or via the CUPS API, to be published as a shared print queue. The printers stanza in the smb.conf file can be set as not browseable. If it is set to be browseable, then it will be visible as if it is a share. That makes no sense given that this meta-service is responsible only for making UNIX system printers available as Windows print queues. If a comment parameter is specified, the value of it will be displayed as part of the printer name in Windows Explorer browse lists.

Each section of the smb.conf file that specifies a share, or a meta-service, is called a stanza. The global stanza specifies settings that affect all the other stanzas in the smb.conf file. Configuration parameters are documented in the smb.conf man page. Some parameters can be used only in the global stanza, some only in share or meta-service stanzas, and some can be used globally or just within a share or meta-service stanza.

A minimal smb.conf contains a very minimal smb.conf.

Example1.1.A minimal smb.conf

[global]
workgroup = WKG
netbios name = MYNAME
[share1]
path = /tmp
[share2]
path = /my_shared_folder
comment = Some random files
Samba HowTo Guide
Prev Home Next

 
 
  Published under the terms fo the GNU General Public License Design by Interspire