FastStart.html   [plain text]


<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 2. Fast Start: Cure for Impatience</title><link rel="stylesheet" href="samba.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.64.1"><link rel="home" href="index.html" title="The Official Samba-3 HOWTO and Reference Guide"><link rel="up" href="introduction.html" title="Part I. General Installation"><link rel="previous" href="install.html" title="Chapter 1. How to Install and Test SAMBA"><link rel="next" href="type.html" title="Part II. Server Configuration Basics"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 2. Fast Start: Cure for Impatience</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="install.html">Prev</a> </td><th width="60%" align="center">Part I. General Installation</th><td width="20%" align="right"> <a accesskey="n" href="type.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="FastStart"></a>Chapter 2. Fast Start: Cure for Impatience</h2></div><div><div class="author"><h3 class="author"><span class="firstname">John</span> <span class="othername">H.</span> <span class="surname">Terpstra</span></h3><div class="affiliation"><span class="orgname">Samba Team<br></span><div class="address"><p><tt class="email">&lt;<a href="mailto:jht@samba.org">jht@samba.org</a>&gt;</tt></p></div></div></div></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="FastStart.html#id2509089">Features and Benefits</a></span></dt><dt><span class="sect1"><a href="FastStart.html#id2509113">Description of Example Sites</a></span></dt><dt><span class="sect1"><a href="FastStart.html#id2443121">Worked Examples</a></span></dt><dd><dl><dt><span class="sect2"><a href="FastStart.html#id2443139">Stand-alone Server</a></span></dt><dt><span class="sect2"><a href="FastStart.html#id2511401">Domain Member Server</a></span></dt><dt><span class="sect2"><a href="FastStart.html#id2512461">Domain Controller</a></span></dt></dl></dd></dl></div><p>
When we first asked for suggestions for inclusion in the Samba HOWTO documentation,
someone wrote asking for example configurations  and lots of them. That is remarkably
difficult to do, without losing a lot of value that can be derived from presenting
many extracts from working systems. That is what the rest of this document does.
It does so with extensive descriptions of the configuration possibilities within the
context of the chapter that covers it. We hope that this chapter is the medicine 
that has been requested.
</p><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2509089"></a>Features and Benefits</h2></div></div><div></div></div><p>
Samba needs very little configuration to create a basic working system.
In this chapter we progress from the simple to the complex, for each providing
all steps and configuration file changes needed to make each work. Please note
that a comprehensively configured system will likely employ additional smart
features. The additional features are covered in the remainder of this document.
</p><p>
The examples used here have been obtained from a number of people who made
requests for example configurations. All identities have been obscured to protect
the guilty and any resemblance to unreal non-existent sites is deliberate.
</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2509113"></a>Description of Example Sites</h2></div></div><div></div></div><p>
In the first set of configuration examples we consider the case of exceptionally simple
system requirements. There is a real temptation to make something that should require
little effort much too complex.
</p><p>
<a href="FastStart.html#anon-ro" title="Anonymous Read-Only Document Server">???</a> documents the type of server that might be sufficient to serve CD-ROM
images, or reference document files for network client use. This configuration is also discussed in 
<a href="StandAloneServer.html" title="Chapter 7. Stand-alone Servers">???</a>, <a href="StandAloneServer.html#RefDocServer" title="Reference Documentation Server">???</a>.
The purpose for this configuration is to provide a shared volume that is read-only that anyone, even guests, can access.
</p><p>
The second example shows a minimal configuration for a print server that anyone can print
to as long as they have the correct printer drivers installed on their computer. This is a
mirror of the system described in <a href="StandAloneServer.html" title="Chapter 7. Stand-alone Servers">???</a>, <a href="StandAloneServer.html#SimplePrintServer" title="Central Print Serving">???</a>.
</p><p>
The next example is of a secure office file and print server that will be accessible only
to users who have an account on the system. This server is meant to closely resemble a
Workgroup file and print server, but has to be more secure than an anonymous access machine.
This type of system will typically suit the needs of a small office. The server does not
provide network logon facilities, offers no Domain Control, instead it is just a network
attached storage (NAS) device and a print server.
</p><p>
Finally, we start looking at more complex systems that will either integrate into existing
Microsoft Windows networks, or replace them entirely. The examples provided cover domain
member servers as well as Samba Domain Control (PDC/BDC) and finally describes in detail
a large distributed network with branch offices in remote locations.
</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2443121"></a>Worked Examples</h2></div></div><div></div></div><p>
The configuration examples are designed to cover everything necessary to get Samba 
running. They do not cover basic operating system platform configuration, which is
clearly beyond the scope of this text.
</p><p>
It is also assumed that Samba has been correctly installed, either by way of installation
of the packages that are provided by the operating system vendor, or through other means.
</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2443139"></a>Stand-alone Server</h3></div></div><div></div></div><p>
	<a class="indexterm" name="id2443147"></a>
	A Stand-alone Server implies no more than the fact that it is not a Domain Controller
	and it does not participate in Domain Control. It can be a simple workgroup-like
	server, or it may be a complex server that is a member of a domain security context.
	</p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="anon-ro"></a>Anonymous Read-Only Document Server</h4></div></div><div></div></div><p>
		<a class="indexterm" name="id2443173"></a>
		The purpose of this type of server is to make available to any user
		any documents or files that are placed on the shared resource. The
		shared resource could be a CD-ROM drive, a CD-ROM image, or a file
		storage area.
		</p><p>
		As the examples are developed, every attempt is made to progress the
		system toward greater capability, just as one might expect would happen
		in a real business office as that office grows in size and its needs
		change.
		</p><p>The configuration file is:</p><div class="example"><a name="anon-example"></a><p class="title"><b>Example 2.1. Anonymous Read-Only Server Configuration</b></p><table class="simplelist" border="0" summary="Simple list"><tr><td># Global parameters</td></tr><tr><td> </td></tr><tr><td><i class="parameter"><tt>[global]</tt></i></td></tr><tr><td><a class="indexterm" name="id2443228"></a><i class="parameter"><tt>
					
				workgroup = MIDEARTH</tt></i></td></tr><tr><td><a class="indexterm" name="id2443244"></a><i class="parameter"><tt>
					
				netbios name = HOBBIT</tt></i></td></tr><tr><td><a class="indexterm" name="id2509470"></a><i class="parameter"><tt>
					
				security = share</tt></i></td></tr><tr><td> </td></tr><tr><td><i class="parameter"><tt>[data]</tt></i></td></tr><tr><td><a class="indexterm" name="id2509494"></a><i class="parameter"><tt>
					
				comment = Data</tt></i></td></tr><tr><td><a class="indexterm" name="id2509510"></a><i class="parameter"><tt>
					
				path = /export</tt></i></td></tr><tr><td><a class="indexterm" name="id2509525"></a><i class="parameter"><tt>
					
				read only = Yes</tt></i></td></tr><tr><td><a class="indexterm" name="id2509540"></a><i class="parameter"><tt>
					
				guest ok = Yes</tt></i></td></tr></table></div><p>
		</p><div class="itemizedlist"><ul type="disc"><li><p>
			The file system share point will be <tt class="filename">/export</tt>.
			</p></li><li><p>
			All files will be owned by a user called Jack Baumbach.
			Jack's login name will be <span class="emphasis"><em>jackb</em></span>. His password will be
			<span class="emphasis"><em>m0r3pa1n</em></span>  of course, that's just the example we are
			using; do not use this in a production environment because
			all readers of this document will know it.
			</p></li></ul></div><div class="procedure"><p class="title"><b>Procedure 2.1. Installation Procedure  Read-Only Server</b></p><ol type="1"><li><p>
			Add user to system (with creation of the users' home directory):
</p><pre class="screen">
<tt class="prompt">root# </tt><b class="userinput"><tt>useradd -c "Jack Baumbach" -m -g users -p m0r3pa1n jackb</tt></b>
</pre><p>
			</p></li><li><p>
			Create directory, and set permissions and ownership:
</p><pre class="screen">
<tt class="prompt">root# </tt><b class="userinput"><tt>mkdir /export</tt></b>
<tt class="prompt">root# </tt><b class="userinput"><tt>chmod u+rwx,g+rx,o+rx /export</tt></b>
<tt class="prompt">root# </tt><b class="userinput"><tt>chown jackb.users /export</tt></b>
</pre><p>
			</p></li><li><p>
			Copy the files that should be shared to the <tt class="filename">/export</tt>
			directory.
			</p></li><li><p>
			Install the Samba configuration file (<tt class="filename">/etc/samba/smb.conf</tt>)
			as shown.
			</p></li><li><p>
			Test the configuration file:
</p><pre class="screen">
<tt class="prompt">root# </tt><b class="userinput"><tt>testparm</tt></b>
</pre><p>
			Note any error messages that might be produced. Do not proceed until you
			obtain error-free output. An example of the output with the following file
			will list the file.
</p><pre class="screen">
Load smb config files from /etc/samba/smb.conf
Processing section "[data]"
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions
<b class="userinput"><tt>[Press enter]</tt></b>

# Global parameters
[global]
	workgroup = MIDEARTH
	netbios name = HOBBIT
	security = share

[data]
	comment = Data
	path = /export
	read only = Yes
	guest only = Yes
</pre><p>
			</p></li><li><p>
			Start Samba using the method applicable to your operating system
			platform.
			</p></li><li><p>
			Configure your Microsoft Windows client for workgroup <span class="emphasis"><em>MIDEARTH</em></span>,
			set the machine name to ROBBINS, reboot, wait a few (2 - 5) minutes,
			then open Windows Explorer and visit the network neighborhood.
			The machine HOBBIT should be visible. When you click this machine
			icon, it should open up to reveal the <span class="emphasis"><em>data</em></span> share. After
			clicking the share it, should open up to reveal the files previously
			placed in the <tt class="filename">/export</tt> directory.
			</p></li></ol></div><p>
		The information above (following # Global parameters) provides the complete
		contents of the <tt class="filename">/etc/samba/smb.conf</tt> file.
		</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2509788"></a>Anonymous Read-Write Document Server</h4></div></div><div></div></div><p>
		<a class="indexterm" name="id2509796"></a>
		We should view this configuration as a progression from the previous example.
		The difference is that shared access is now forced to the user identity of jackb
		and to the primary group jackb belongs to. One other refinement we can make is to
		add the user <span class="emphasis"><em>jackb</em></span> to the <tt class="filename">smbpasswd</tt> file.
		To do this execute:
</p><pre class="screen">
<tt class="prompt">root# </tt><b class="userinput"><tt>smbpasswd -a jackb</tt></b>
New SMB password: <b class="userinput"><tt>m0r3pa1n</tt></b>
Retype new SMB password: <b class="userinput"><tt>m0r3pa1n</tt></b>
Added user jackb.
</pre><p>
		Addition of this user to the <tt class="filename">smbpasswd</tt> file allows all files
		to be displayed in the Explorer Properties boxes as belonging to <span class="emphasis"><em>jackb</em></span>
		instead of to <span class="emphasis"><em>User Unknown</em></span>.
		</p><p>
		The complete, modified <tt class="filename">smb.conf</tt> file is as shown in <a href="FastStart.html#anon-rw" title="Example 2.2. Modified Anonymous Read-Write smb.conf">???</a>.
		</p><p>
</p><div class="example"><a name="anon-rw"></a><p class="title"><b>Example 2.2. Modified Anonymous Read-Write smb.conf</b></p><table class="simplelist" border="0" summary="Simple list"><tr><td># Global parameters</td></tr><tr><td> </td></tr><tr><td><i class="parameter"><tt>[global]</tt></i></td></tr><tr><td><a class="indexterm" name="id2509913"></a><i class="parameter"><tt>
					
				workgroup = MIDEARTH</tt></i></td></tr><tr><td><a class="indexterm" name="id2509928"></a><i class="parameter"><tt>
					
				netbios name = HOBBIT</tt></i></td></tr><tr><td><a class="indexterm" name="id2509944"></a><i class="parameter"><tt>
					
				security = SHARE</tt></i></td></tr><tr><td> </td></tr><tr><td><i class="parameter"><tt>[data]</tt></i></td></tr><tr><td><a class="indexterm" name="id2509969"></a><i class="parameter"><tt>
					
				comment = Data</tt></i></td></tr><tr><td><a class="indexterm" name="id2509985"></a><i class="parameter"><tt>
					
				path = /export</tt></i></td></tr><tr><td><a class="indexterm" name="id2510000"></a><i class="parameter"><tt>
					
				force user = jackb</tt></i></td></tr><tr><td><a class="indexterm" name="id2510016"></a><i class="parameter"><tt>
					
				force group = users</tt></i></td></tr><tr><td><a class="indexterm" name="id2510031"></a><i class="parameter"><tt>
					
				read only = No</tt></i></td></tr><tr><td><a class="indexterm" name="id2510047"></a><i class="parameter"><tt>
					
				guest ok = Yes</tt></i></td></tr></table></div><p>
		</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2510065"></a>Anonymous Print Server</h4></div></div><div></div></div><p>
		<a class="indexterm" name="id2510073"></a>
		An anonymous print server serves two purposes:
		</p><div class="itemizedlist"><ul type="disc"><li><p>
			It allows printing to all printers from a single location.
			</p></li><li><p>
			It reduces network traffic congestion due to many users trying
			to access a limited number of printers.
			</p></li></ul></div><p>
		In the simplest of anonymous print servers, it is common to require the installation
		of the correct printer drivers on the Windows workstation. In this case the print
		server will be designed to just pass print jobs through to the spooler, and the spooler
		should be configured to do raw pass-through to the printer. In other words, the print
		spooler should not filter or process the data stream being passed to the printer.
		</p><p>
		In this configuration it is undesirable to present the Add Printer Wizard and we do
		not want to have automatic driver download, so we will disable it in the following
		configuration. <a href="FastStart.html#anon-print" title="Example 2.3. Anonymous Print Server smb.conf">???</a> is the resulting <tt class="filename">smb.conf</tt> file.
		</p><p>
</p><div class="example"><a name="anon-print"></a><p class="title"><b>Example 2.3. Anonymous Print Server smb.conf</b></p><table class="simplelist" border="0" summary="Simple list"><tr><td># Global parameters</td></tr><tr><td> </td></tr><tr><td><i class="parameter"><tt>[global]</tt></i></td></tr><tr><td><a class="indexterm" name="id2510159"></a><i class="parameter"><tt>
					
				workgroup = MIDEARTH</tt></i></td></tr><tr><td><a class="indexterm" name="id2510174"></a><i class="parameter"><tt>
					
				netbios name = LUTHIEN</tt></i></td></tr><tr><td><a class="indexterm" name="id2510190"></a><i class="parameter"><tt>
					
				security = share</tt></i></td></tr><tr><td><a class="indexterm" name="id2510206"></a><i class="parameter"><tt>
					
				printcap name = cups</tt></i></td></tr><tr><td><a class="indexterm" name="id2510222"></a><i class="parameter"><tt>
					
				disable spoolss = Yes</tt></i></td></tr><tr><td><a class="indexterm" name="id2510238"></a><i class="parameter"><tt>
					
				show add printer wizard = No</tt></i></td></tr><tr><td><a class="indexterm" name="id2510254"></a><i class="parameter"><tt>
					
				printing = cups</tt></i></td></tr><tr><td> </td></tr><tr><td><i class="parameter"><tt>[printers]</tt></i></td></tr><tr><td><a class="indexterm" name="id2510278"></a><i class="parameter"><tt>
					
				comment = All Printers</tt></i></td></tr><tr><td><a class="indexterm" name="id2510294"></a><i class="parameter"><tt>
					
				path = /var/spool/samba</tt></i></td></tr><tr><td><a class="indexterm" name="id2510310"></a><i class="parameter"><tt>
					
				guest ok = Yes</tt></i></td></tr><tr><td><a class="indexterm" name="id2510326"></a><i class="parameter"><tt>
					
				printable = Yes</tt></i></td></tr><tr><td><a class="indexterm" name="id2510341"></a><i class="parameter"><tt>
					
				use client driver = Yes</tt></i></td></tr><tr><td><a class="indexterm" name="id2510357"></a><i class="parameter"><tt>
					
				browseable = No</tt></i></td></tr></table></div><p>
		</p><p>
		The above configuration is not ideal. It uses no smart features, and it deliberately
		presents a less than elegant solution. But it is basic, and it does print.
		</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
		Windows users will need to install a local printer and then change the print
		to device after installation of the drivers. The print to device can then be set to
		the network printer on this machine.
		</p></div><p>
		Make sure that the directory <tt class="filename">/var/spool/samba</tt> is capable of being used
		as intended. The following steps must be taken to achieve this:
		</p><div class="itemizedlist"><ul type="disc"><li><p>
			The directory must be owned by the superuser (root) user and group:
</p><pre class="screen">
<tt class="prompt">root# </tt><b class="userinput"><tt>chown root.root /var/spool/samba</tt></b>
</pre><p>
			</p></li><li><p>
			Directory permissions should be set for public read-write with the
			sticky-bit set as shown:
</p><pre class="screen">
<tt class="prompt">root# </tt><b class="userinput"><tt>chmod a+rw TX /var/spool/samba</tt></b>
</pre><p>
			</p></li></ul></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
		<a class="indexterm" name="id2510450"></a>
		<a class="indexterm" name="id2510459"></a>
		On CUPS enabled systems there is a facility to pass raw data directly to the printer without
		intermediate processing via CUPS print filters. Where use of this mode of operation is desired
		it is necessary to configure a raw printing device. It is also necessary to enable the raw mime
		handler in the <tt class="filename">/etc/mime.conv</tt> and <tt class="filename">/etc/mime.types</tt>
		files. Refer to <a href="CUPS-printing.html#cups-raw" title="Explicitly Enable raw Printing for application/octet-stream">???</a>.
		</p></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2510493"></a>Secure Read-Write File and Print Server</h4></div></div><div></div></div><p>
		We progress now from simple systems to a server that is slightly more complex.
		</p><p>
		Our new server will require a public data storage area in which only authenticated
		users (i.e., those with a local account) can store files, as well as a home directory.
		There will be one printer that should be available for everyone to use.
		</p><p>
		In this hypothetical environment (no espionage was conducted to obtain this data),
		the site is demanding a simple environment that is <span class="emphasis"><em>secure enough</em></span>
		but not too difficult to use. 
		</p><p>
		Site users will be: Jack Baumbach, Mary Orville and Amed Sehkah. Each will have
		a password (not shown in further examples). Mary will be the printer administrator and will
		own all files in the public share.
		</p><p>
		This configuration will be based on <span class="emphasis"><em>User Level Security</em></span> that
		is the default, and for which the default is to store Microsoft Windows-compatible
		encrypted passwords in a file called <tt class="filename">/etc/samba/smbpasswd</tt>.
		The default <tt class="filename">smb.conf</tt> entry that makes this happen is:
		<a class="indexterm" name="id2510550"></a>passdb backend = smbpasswd, guest. Since this is the default
		it is not necessary to enter it into the configuration file. Note that guest backend is
		added to the list of active passdb backends not matter was it specified directly in Samba configuration
		file or not.
		</p><div class="procedure"><p class="title"><b>Procedure 2.2. Installing the Secure Office Server</b></p><ol type="1"><li><p>
		<a class="indexterm" name="id2510574"></a>
			Add all users to the Operating System:
</p><pre class="screen">
<tt class="prompt">root# </tt><b class="userinput"><tt>useradd -c "Jack Baumbach" -m -g users -p m0r3pa1n jackb</tt></b>
<tt class="prompt">root# </tt><b class="userinput"><tt>useradd -c "Mary Orville" -m -g users -p secret maryo</tt></b>
<tt class="prompt">root# </tt><b class="userinput"><tt>useradd -c "Amed Sehkah" -m -g users -p secret ameds</tt></b>
</pre><p>
			</p></li><li><p>
			Configure the Samba <tt class="filename">smb.conf</tt> file as shown in <a href="FastStart.html#OfficeServer" title="Example 2.4. Secure Office Server smb.conf">???</a>.
</p><div class="example"><a name="OfficeServer"></a><p class="title"><b>Example 2.4. Secure Office Server smb.conf</b></p><table class="simplelist" border="0" summary="Simple list"><tr><td># Global parameters</td></tr><tr><td> </td></tr><tr><td><i class="parameter"><tt>[global]</tt></i></td></tr><tr><td><a class="indexterm" name="id2510669"></a><i class="parameter"><tt>
					
				workgroup = MIDEARTH</tt></i></td></tr><tr><td><a class="indexterm" name="id2510685"></a><i class="parameter"><tt>
					
				netbios name = OLORIN</tt></i></td></tr><tr><td><a class="indexterm" name="id2510700"></a><i class="parameter"><tt>
					
				printcap name = cups</tt></i></td></tr><tr><td><a class="indexterm" name="id2510716"></a><i class="parameter"><tt>
					
				disable spoolss = Yes</tt></i></td></tr><tr><td><a class="indexterm" name="id2510732"></a><i class="parameter"><tt>
					
				show add printer wizard = No</tt></i></td></tr><tr><td><a class="indexterm" name="id2510748"></a><i class="parameter"><tt>
					
				printing = cups</tt></i></td></tr><tr><td> </td></tr><tr><td><i class="parameter"><tt>[homes]</tt></i></td></tr><tr><td><a class="indexterm" name="id2510773"></a><i class="parameter"><tt>
					
				comment = Home Directories</tt></i></td></tr><tr><td><a class="indexterm" name="id2510789"></a><i class="parameter"><tt>
					
				valid users = %S</tt></i></td></tr><tr><td><a class="indexterm" name="id2510804"></a><i class="parameter"><tt>
					
				read only = No</tt></i></td></tr><tr><td><a class="indexterm" name="id2510820"></a><i class="parameter"><tt>
					
				browseable = No</tt></i></td></tr><tr><td> </td></tr><tr><td><i class="parameter"><tt>[public]</tt></i></td></tr><tr><td><a class="indexterm" name="id2510844"></a><i class="parameter"><tt>
					
				comment = Data</tt></i></td></tr><tr><td><a class="indexterm" name="id2510860"></a><i class="parameter"><tt>
					
				path = /export</tt></i></td></tr><tr><td><a class="indexterm" name="id2510876"></a><i class="parameter"><tt>
					
				force user = maryo</tt></i></td></tr><tr><td><a class="indexterm" name="id2510891"></a><i class="parameter"><tt>
					
				force group = users</tt></i></td></tr><tr><td><a class="indexterm" name="id2510907"></a><i class="parameter"><tt>
					
				guest ok = Yes</tt></i></td></tr><tr><td><a class="indexterm" name="id2510923"></a><i class="parameter"><tt>
					
				read only = No</tt></i></td></tr><tr><td> </td></tr><tr><td><i class="parameter"><tt>[printers]</tt></i></td></tr><tr><td><a class="indexterm" name="id2510947"></a><i class="parameter"><tt>
					
				comment = All Printers</tt></i></td></tr><tr><td><a class="indexterm" name="id2510962"></a><i class="parameter"><tt>
					
				path = /var/spool/samba</tt></i></td></tr><tr><td><a class="indexterm" name="id2510978"></a><i class="parameter"><tt>
					
				printer admin = root, maryo</tt></i></td></tr><tr><td><a class="indexterm" name="id2510994"></a><i class="parameter"><tt>
					
				create mask = 0600</tt></i></td></tr><tr><td><a class="indexterm" name="id2511010"></a><i class="parameter"><tt>
					
				guest ok = Yes</tt></i></td></tr><tr><td><a class="indexterm" name="id2511026"></a><i class="parameter"><tt>
					
				printable = Yes</tt></i></td></tr><tr><td><a class="indexterm" name="id2511041"></a><i class="parameter"><tt>
					
				use client driver = Yes</tt></i></td></tr><tr><td><a class="indexterm" name="id2511057"></a><i class="parameter"><tt>
					
				browseable = No</tt></i></td></tr></table></div><p>
			</p></li><li><p>
			Initialize the Microsoft Windows password database with the new users:
</p><pre class="screen">
<tt class="prompt">root# </tt><b class="userinput"><tt>smbpasswd -a root</tt></b>
New SMB password: <b class="userinput"><tt>bigsecret</tt></b>
Reenter smb password: <b class="userinput"><tt>bigsecret</tt></b>
Added user root.

<tt class="prompt">root# </tt><b class="userinput"><tt>smbpasswd -a jackb</tt></b>
New SMB password: <b class="userinput"><tt>m0r3pa1n</tt></b>
Retype new SMB password: <b class="userinput"><tt>m0r3pa1n</tt></b>
Added user jackb.

<tt class="prompt">root# </tt><b class="userinput"><tt>smbpasswd -a maryo</tt></b>
New SMB password: <b class="userinput"><tt>secret</tt></b>
Reenter smb password: <b class="userinput"><tt>secret</tt></b>
Added user maryo.

<tt class="prompt">root# </tt><b class="userinput"><tt>smbpasswd -a ameds</tt></b>
New SMB password: <b class="userinput"><tt>mysecret</tt></b>
Reenter smb password: <b class="userinput"><tt>mysecret</tt></b>
Added user ameds.
</pre><p>
			</p></li><li><p>
			Install printer using the CUPS Web interface. Make certain that all
			printers that will be shared with Microsoft Windows clients are installed
			as raw printing devices.
			</p></li><li><p>
			Start Samba using the operating system administrative interface.
			Alternately, this can be done manually by running:
			<a class="indexterm" name="id2511198"></a>
			<a class="indexterm" name="id2511205"></a>
			<a class="indexterm" name="id2511212"></a>
			<a class="indexterm" name="id2511221"></a>
</p><pre class="screen">
<tt class="prompt">root# </tt><b class="userinput"><tt> nmbd; smbd;</tt></b>
</pre><p>
			</p></li><li><p>
			Configure the <tt class="filename">/export</tt> directory:
</p><pre class="screen">
<tt class="prompt">root# </tt><b class="userinput"><tt>mkdir /export</tt></b>
<tt class="prompt">root# </tt><b class="userinput"><tt>chown maryo.users /export</tt></b>
<tt class="prompt">root# </tt><b class="userinput"><tt>chmod u=rwx,g=rwx,o-rwx /export</tt></b>
</pre><p>
			</p></li><li><p>
			Check that Samba is running correctly:
</p><pre class="screen">
<tt class="prompt">root# </tt><b class="userinput"><tt>smbclient -L localhost -U%</tt></b>
Domain=[MIDEARTH] OS=[UNIX] Server=[Samba-3.0.0]

Sharename      Type      Comment
---------      ----      -------
public         Disk      Data
IPC$           IPC       IPC Service (Samba-3.0.0)
ADMIN$         IPC       IPC Service (Samba-3.0.0)
hplj4          Printer   hplj4

Server               Comment
---------            -------
OLORIN               Samba-3.0.0

Workgroup            Master
---------            -------
MIDEARTH             OLORIN
</pre><p>
			</p></li><li><p>
			Connect to OLORIN as maryo:
</p><pre class="screen">
<tt class="prompt">root# </tt><b class="userinput"><tt>smbclient //olorin/maryo -Umaryo%secret</tt></b>
OS=[UNIX] Server=[Samba-3.0.0]
smb: \&gt; <b class="userinput"><tt>dir</tt></b>
.                             D        0  Sat Jun 21 10:58:16 2003
..                            D        0  Sat Jun 21 10:54:32 2003
Documents                      D        0  Fri Apr 25 13:23:58 2003
DOCWORK                        D        0  Sat Jun 14 15:40:34 2003
OpenOffice.org                 D        0  Fri Apr 25 13:55:16 2003
.bashrc                        H     1286  Fri Apr 25 13:23:58 2003
.netscape6                    DH        0  Fri Apr 25 13:55:13 2003
.mozilla                      DH        0  Wed Mar  5 11:50:50 2003
.kermrc                        H      164  Fri Apr 25 13:23:58 2003
.acrobat                      DH        0  Fri Apr 25 15:41:02 2003

		55817 blocks of size 524288. 34725 blocks available
smb: \&gt; <b class="userinput"><tt>q</tt></b>
</pre><p>
			</p></li></ol></div></div><p>
	By now you should be getting the hang of configuration basics. Clearly, it is time to
	explore slightly more complex examples. For the remainder of this chapter we will abbreviate
	instructions since there are previous examples.
	</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2511401"></a>Domain Member Server</h3></div></div><div></div></div><p>
	<a class="indexterm" name="id2511409"></a>
	In this instance we will consider the simplest server configuration we can get away with
	to make an accounting department happy. Let's be warned, the users are accountants and they
	do have some nasty demands. There is a budget for only one server for this department.
	</p><p>
	The network is managed by an internal Information Services Group (ISG), to which we belong.
	Internal politics are typical of a medium-sized organization; Human Resources is of the
	opinion that they run the ISG because they are always adding and disabling users. Also,
	departmental managers have to fight tooth and nail to gain basic network resources access for
	their staff. Accounting is different though, they get exactly what they want. So this should
	set the scene.
	</p><p>
	We will use the users from the last example. The accounting department
	has a general printer that all departmental users may. There is also a check printer
	that may be used only by the person who has authority to print checks. The Chief Financial
	Officer (CFO) wants that printer to be completely restricted and for it to be located in the
	private storage area in her office. It therefore must be a network printer.
	</p><p>
	Accounting department uses an accounting application called <span class="emphasis"><em>SpytFull</em></span>
	that must be run from a central application server. The software is licensed to run only off
	one server, there are no workstation components, and it is run off a mapped share. The data
	store is in a UNIX-based SQL backend. The UNIX gurus look after that, so is not our
	problem.
	</p><p>
	The accounting department manager (maryo) wants a general filing system as well as a separate
	file storage area for form letters (nastygrams). The form letter area should be read-only to
	all accounting staff except the manager. The general filing system has to have a structured
	layout with a general area for all staff to store general documents, as well as a separate
	file area for each member of her team that is private to that person, but she wants full
	access to all areas. Users must have a private home share for personal work-related files
	and for materials not related to departmental operations.
	</p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2511473"></a>Example Configuration</h4></div></div><div></div></div><p>
		The server <span class="emphasis"><em>valinor</em></span> will be a member server of the company domain.
		Accounting will have only a local server. User accounts will be on the Domain Controllers
		as will desktop profiles and all network policy files.
		</p><div class="procedure"><ol type="1"><li><p>
			Do not add users to the UNIX/Linux server; all of this will run off the
			central domain.
			</p></li><li><p>
			Configure <tt class="filename">smb.conf</tt> according to <a href="FastStart.html#fast-member-server" title="Example 2.5. Member server smb.conf (globals)">???</a>
			and <a href="FastStart.html#fast-memberserver-shares" title="Example 2.6. Member server smb.conf (shares and services)">???</a>.
			</p><p>
			</p><div class="example"><a name="fast-member-server"></a><p class="title"><b>Example 2.5. Member server smb.conf (globals)</b></p><table class="simplelist" border="0" summary="Simple list"><tr><td># Global parameters</td></tr><tr><td> </td></tr><tr><td><i class="parameter"><tt>[global]</tt></i></td></tr><tr><td><a class="indexterm" name="id2511557"></a><i class="parameter"><tt>
					
				workgroup = MIDEARTH</tt></i></td></tr><tr><td><a class="indexterm" name="id2511573"></a><i class="parameter"><tt>
					
				netbios name = VALINOR</tt></i></td></tr><tr><td><a class="indexterm" name="id2511589"></a><i class="parameter"><tt>
					
				security = DOMAIN</tt></i></td></tr><tr><td><a class="indexterm" name="id2511604"></a><i class="parameter"><tt>
					
				printcap name = cups</tt></i></td></tr><tr><td><a class="indexterm" name="id2511620"></a><i class="parameter"><tt>
					
				disable spoolss = Yes</tt></i></td></tr><tr><td><a class="indexterm" name="id2511636"></a><i class="parameter"><tt>
					
				show add printer wizard = No</tt></i></td></tr><tr><td><a class="indexterm" name="id2511652"></a><i class="parameter"><tt>
					
				idmap uid = 15000-20000</tt></i></td></tr><tr><td><a class="indexterm" name="id2511668"></a><i class="parameter"><tt>
					
				idmap gid = 15000-20000</tt></i></td></tr><tr><td><a class="indexterm" name="id2511684"></a><i class="parameter"><tt>
					
				winbind use default domain = Yes</tt></i></td></tr><tr><td><a class="indexterm" name="id2511700"></a><i class="parameter"><tt>
					
				use sendfile = Yes</tt></i></td></tr><tr><td><a class="indexterm" name="id2511716"></a><i class="parameter"><tt>
					
				printing = cups</tt></i></td></tr></table></div><p>
			</p><div class="example"><a name="fast-memberserver-shares"></a><p class="title"><b>Example 2.6. Member server smb.conf (shares and services)</b></p><table class="simplelist" border="0" summary="Simple list"><tr><td> </td></tr><tr><td><i class="parameter"><tt>[homes]</tt></i></td></tr><tr><td><a class="indexterm" name="id2511757"></a><i class="parameter"><tt>
					
				comment = Home Directories</tt></i></td></tr><tr><td><a class="indexterm" name="id2511773"></a><i class="parameter"><tt>
					
				valid users = %S</tt></i></td></tr><tr><td><a class="indexterm" name="id2511788"></a><i class="parameter"><tt>
					
				read only = No</tt></i></td></tr><tr><td><a class="indexterm" name="id2511804"></a><i class="parameter"><tt>
					
				browseable = No</tt></i></td></tr><tr><td> </td></tr><tr><td><i class="parameter"><tt>[spytfull]</tt></i></td></tr><tr><td><a class="indexterm" name="id2511828"></a><i class="parameter"><tt>
					
				comment = Accounting Application Only</tt></i></td></tr><tr><td><a class="indexterm" name="id2511845"></a><i class="parameter"><tt>
					
				path = /export/spytfull</tt></i></td></tr><tr><td><a class="indexterm" name="id2511860"></a><i class="parameter"><tt>
					
				valid users = @Accounts</tt></i></td></tr><tr><td><a class="indexterm" name="id2511876"></a><i class="parameter"><tt>
					
				admin users = maryo</tt></i></td></tr><tr><td><a class="indexterm" name="id2511891"></a><i class="parameter"><tt>
					
				read only = Yes</tt></i></td></tr><tr><td> </td></tr><tr><td><i class="parameter"><tt>[public]</tt></i></td></tr><tr><td><a class="indexterm" name="id2511916"></a><i class="parameter"><tt>
					
				comment = Data</tt></i></td></tr><tr><td><a class="indexterm" name="id2511932"></a><i class="parameter"><tt>
					
				path = /export/public</tt></i></td></tr><tr><td><a class="indexterm" name="id2511947"></a><i class="parameter"><tt>
					
				read only = No</tt></i></td></tr><tr><td> </td></tr><tr><td><i class="parameter"><tt>[printers]</tt></i></td></tr><tr><td><a class="indexterm" name="id2511972"></a><i class="parameter"><tt>
					
				comment = All Printers</tt></i></td></tr><tr><td><a class="indexterm" name="id2511987"></a><i class="parameter"><tt>
					
				path = /var/spool/samba</tt></i></td></tr><tr><td><a class="indexterm" name="id2512003"></a><i class="parameter"><tt>
					
				printer admin = root, maryo</tt></i></td></tr><tr><td><a class="indexterm" name="id2512019"></a><i class="parameter"><tt>
					
				create mask = 0600</tt></i></td></tr><tr><td><a class="indexterm" name="id2512035"></a><i class="parameter"><tt>
					
				guest ok = Yes</tt></i></td></tr><tr><td><a class="indexterm" name="id2512050"></a><i class="parameter"><tt>
					
				printable = Yes</tt></i></td></tr><tr><td><a class="indexterm" name="id2512066"></a><i class="parameter"><tt>
					
				use client driver = Yes</tt></i></td></tr><tr><td><a class="indexterm" name="id2512082"></a><i class="parameter"><tt>
					
				browseable = No</tt></i></td></tr></table></div><p>
			</p></li><li><p>
<a class="indexterm" name="id2512104"></a>
			Join the domain. Note: Do not start Samba until this step has been completed!
</p><pre class="screen">
<tt class="prompt">root# </tt><b class="userinput"><tt>net rpc join -Uroot%'bigsecret'</tt></b>
Joined domain MIDEARTH.
</pre><p>
			</p></li><li><p>
			Make absolutely certain that you disable (shut down) the <span><b class="command">nscd</b></span>
			daemon on any system on which <span><b class="command">winbind</b></span> is configured to run.
			</p></li><li><p>
			Start Samba following the normal method for your operating system platform.
			If you wish to this manually execute as root:
			<a class="indexterm" name="id2512161"></a>
			<a class="indexterm" name="id2512168"></a>
			<a class="indexterm" name="id2512175"></a>
			<a class="indexterm" name="id2512182"></a>
			<a class="indexterm" name="id2512191"></a>
			<a class="indexterm" name="id2512200"></a>
</p><pre class="screen">
<tt class="prompt">root# </tt><b class="userinput"><tt>nmbd; smbd; winbindd;</tt></b>
</pre><p>
			</p></li><li><p>
			Configure the name service switch control file on your system to resolve user and group names
			via winbind. Edit the following lines in <tt class="filename">/etc/nsswitch.conf</tt>:
</p><pre class="programlisting">
passwd: files winbind
group:  files winbind
hosts:  files dns winbind
</pre><p>
			</p></li><li><p>
			Set the password for <span><b class="command">wbinfo</b></span> to use:
</p><pre class="screen">
<tt class="prompt">root# </tt><b class="userinput"><tt>wbinfo --set-auth-user=root%'bigsecret'</tt></b>
</pre><p>
			</p></li><li><p>
			Validate that domain user and group credentials can be correctly resolved by executing:
</p><pre class="screen">
<tt class="prompt">root# </tt><b class="userinput"><tt>wbinfo -u</tt></b>
MIDEARTH\maryo
MIDEARTH\jackb
MIDEARTH\ameds
...
MIDEARTH\root

<tt class="prompt">root# </tt><b class="userinput"><tt>wbinfo -g</tt></b>
MIDEARTH\Domain Users
MIDEARTH\Domain Admins
MIDEARTH\Domain Guests
...
MIDEARTH\Accounts
</pre><p>
			</p></li><li><p>
			Check that <span><b class="command">winbind</b></span> is working. The following demonstrates correct
			username resolution via the <span><b class="command">getent</b></span> system utility:
</p><pre class="screen">
<tt class="prompt">root# </tt><b class="userinput"><tt>getent passwd maryo</tt></b>
maryo:x:15000:15003:Mary Orville:/home/MIDEARTH/maryo:/bin/false
</pre><p>
			</p></li><li><p>
			A final test that we have this under control might be reassuring:
</p><pre class="screen">
<tt class="prompt">root# </tt><b class="userinput"><tt>touch /export/a_file</tt></b>
<tt class="prompt">root# </tt><b class="userinput"><tt>chown maryo /export/a_file</tt></b>
<tt class="prompt">root# </tt><b class="userinput"><tt>ls -al /export/a_file</tt></b>
...
-rw-r--r--    1 maryo    users       11234 Jun 21 15:32 a_file
...

<tt class="prompt">root# </tt><b class="userinput"><tt>rm /export/a_file</tt></b>
</pre><p>
			</p></li><li><p>
			Configuration is now mostly complete, so this is an opportune time
			to configure the directory structure for this site:
</p><pre class="screen">
<tt class="prompt">root# </tt><b class="userinput"><tt>mkdir -p /export/{spytfull,public}</tt></b>
<tt class="prompt">root# </tt><b class="userinput"><tt>chmod ug=rwxS,o=x /export/{spytfull,public}</tt></b>
<tt class="prompt">root# </tt><b class="userinput"><tt>chown maryo.Accounts /export/{spytfull,public}</tt></b>
</pre><p>
			</p></li></ol></div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2512461"></a>Domain Controller</h3></div></div><div></div></div><p>
	<a class="indexterm" name="id2512469"></a>
	For the remainder of this chapter the focus is on the configuration of Domain Control.
	The examples that follow are for two implementation strategies. Remember, our objective is
	to create a simple but working solution. The remainder of this book should help to highlight
	opportunity for greater functionality and the complexity that goes with it.
	</p><p>
	A Domain Controller configuration can be achieved with a simple configuration using the new
	tdbsam password backend. This type of configuration is good for small
	offices, but has limited scalability (cannot be replicated) and performance can be expected
	to fall as the size and complexity of the domain increases.
	</p><p>
	The use of tdbsam is best limited to sites that do not need
	more than a primary Domain Controller (PDC). As the size of a domain grows the need
	for additional Domain Controllers becomes apparent. Do not attempt to under-resource
	a Microsoft Windows network environment; Domain Controllers provide essential
	authentication services. The following are symptoms of an under-resourced Domain Control
	environment:
	</p><div class="itemizedlist"><ul type="disc"><li><p>
		 Domain logons intermittently fail.
		</p></li><li><p>
		File access on a Domain Member server intermittently fails, giving a permission denied
		error message.
		</p></li></ul></div><p>
	A more scalable Domain Control authentication backend option might use
	Microsoft Active Directory, or an LDAP-based backend. Samba-3 provides
	for both options as a Domain Member server. As a PDC Samba-3 is not able to provide
	an exact alternative to the functionality that is available with Active Directory.
	Samba-3 can provide a scalable LDAP-based PDC/BDC solution.
	</p><p>
	The tdbsam authentication backend provides no facility to replicate
	the contents of the database, except by external means. (i.e., there is no self-contained protocol
	in Samba-3 for Security Account Manager database [SAM] replication.)
	</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
	If you need more than one Domain Controller, do not use a tdbsam authentication backend.
	</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2512542"></a>Example: Engineering Office</h4></div></div><div></div></div><p>
		The engineering office network server we present here is designed to demonstrate use
		of the new tdbsam password backend. The tdbsam
		facility is new to Samba-3. It is designed to provide many user and machine account controls
		that are possible with Microsoft Windows NT4. It is safe to use this in smaller networks.
		</p><div class="procedure"><ol type="1"><li><p>
			A working PDC configuration using the tdbsam
			password backend can be found in <a href="FastStart.html#fast-engoffice-global" title="Example 2.7. Engineering Office smb.conf (globals)">???</a> together with
			<a href="FastStart.html#fast-engoffice-shares" title="Example 2.8. Engineering Office smb.conf (shares and services)">???</a>:
			</p><p>
<a class="indexterm" name="id2512585"></a>
			</p><div class="example"><a name="fast-engoffice-global"></a><p class="title"><b>Example 2.7. Engineering Office smb.conf (globals)</b></p><table class="simplelist" border="0" summary="Simple list"><tr><td> </td></tr><tr><td><i class="parameter"><tt>[global]</tt></i></td></tr><tr><td><a class="indexterm" name="id2512615"></a><i class="parameter"><tt>
					
				workgroup = MIDEARTH</tt></i></td></tr><tr><td><a class="indexterm" name="id2512630"></a><i class="parameter"><tt>
					
				netbios name = FRODO</tt></i></td></tr><tr><td><a class="indexterm" name="id2512646"></a><i class="parameter"><tt>
					
				passdb backend = tdbsam</tt></i></td></tr><tr><td><a class="indexterm" name="id2512662"></a><i class="parameter"><tt>
					
				printcap name = cups</tt></i></td></tr><tr><td><a class="indexterm" name="id2512677"></a><i class="parameter"><tt>
					
				add user script = /usr/sbin/useradd -m %u</tt></i></td></tr><tr><td><a class="indexterm" name="id2512694"></a><i class="parameter"><tt>
					
				delete user script = /usr/sbin/userdel -r %u</tt></i></td></tr><tr><td><a class="indexterm" name="id2512710"></a><i class="parameter"><tt>
					
				add group script = /usr/sbin/groupadd %g</tt></i></td></tr><tr><td><a class="indexterm" name="id2512726"></a><i class="parameter"><tt>
					
				delete group script = /usr/sbin/groupdel %g</tt></i></td></tr><tr><td><a class="indexterm" name="id2512743"></a><i class="parameter"><tt>
					
				add user to group script = /usr/sbin/usermod -G %g %u</tt></i></td></tr><tr><td><a class="indexterm" name="id2512759"></a><i class="parameter"><tt>
					
				add machine script = /usr/sbin/useradd -s /bin/false \</tt></i></td></tr><tr><td><i class="parameter"><tt>        -d /dev/null %u</tt></i></td></tr><tr><td># Note: The following specifies the default logon script.</td></tr><tr><td># Per user logon scripts can be specified in the user account using pdbedit </td></tr><tr><td><a class="indexterm" name="id2512797"></a><i class="parameter"><tt>
					
				logon script = scripts\logon.bat</tt></i></td></tr><tr><td># This sets the default profile path. Set per user paths with pdbedit</td></tr><tr><td><a class="indexterm" name="id2512820"></a><i class="parameter"><tt>
					
				logon path = \\%L\Profiles\%U</tt></i></td></tr><tr><td><a class="indexterm" name="id2512836"></a><i class="parameter"><tt>
					
				logon drive = H:</tt></i></td></tr><tr><td><a class="indexterm" name="id2512851"></a><i class="parameter"><tt>
					
				logon home = \\%L\%U</tt></i></td></tr><tr><td><a class="indexterm" name="id2512867"></a><i class="parameter"><tt>
					
				domain logons = Yes</tt></i></td></tr><tr><td><a class="indexterm" name="id2512883"></a><i class="parameter"><tt>
					
				os level = 35</tt></i></td></tr><tr><td><a class="indexterm" name="id2512899"></a><i class="parameter"><tt>
					
				preferred master = Yes</tt></i></td></tr><tr><td><a class="indexterm" name="id2512914"></a><i class="parameter"><tt>
					
				domain master = Yes</tt></i></td></tr><tr><td><a class="indexterm" name="id2512930"></a><i class="parameter"><tt>
					
				idmap uid = 15000-20000</tt></i></td></tr><tr><td><a class="indexterm" name="id2512946"></a><i class="parameter"><tt>
					
				idmap gid = 15000-20000</tt></i></td></tr><tr><td><a class="indexterm" name="id2512962"></a><i class="parameter"><tt>
					
				printing = cups</tt></i></td></tr></table></div><p>

			</p><div class="example"><a name="fast-engoffice-shares"></a><p class="title"><b>Example 2.8. Engineering Office smb.conf (shares and services)</b></p><table class="simplelist" border="0" summary="Simple list"><tr><td> </td></tr><tr><td><i class="parameter"><tt>[homes]</tt></i></td></tr><tr><td><a class="indexterm" name="id2513001"></a><i class="parameter"><tt>
					
				comment = Home Directories</tt></i></td></tr><tr><td><a class="indexterm" name="id2513017"></a><i class="parameter"><tt>
					
				valid users = %S</tt></i></td></tr><tr><td><a class="indexterm" name="id2513033"></a><i class="parameter"><tt>
					
				read only = No</tt></i></td></tr><tr><td><a class="indexterm" name="id2513048"></a><i class="parameter"><tt>
					
				browseable = No</tt></i></td></tr><tr><td># Printing auto-share (makes printers available thru CUPS)</td></tr><tr><td> </td></tr><tr><td><i class="parameter"><tt>[printers]</tt></i></td></tr><tr><td><a class="indexterm" name="id2513079"></a><i class="parameter"><tt>
					
				comment = All Printers</tt></i></td></tr><tr><td><a class="indexterm" name="id2513095"></a><i class="parameter"><tt>
					
				path = /var/spool/samba</tt></i></td></tr><tr><td><a class="indexterm" name="id2513111"></a><i class="parameter"><tt>
					
				printer admin = root, maryo</tt></i></td></tr><tr><td><a class="indexterm" name="id2513127"></a><i class="parameter"><tt>
					
				create mask = 0600</tt></i></td></tr><tr><td><a class="indexterm" name="id2513142"></a><i class="parameter"><tt>
					
				guest ok = Yes</tt></i></td></tr><tr><td><a class="indexterm" name="id2513158"></a><i class="parameter"><tt>
					
				printable = Yes</tt></i></td></tr><tr><td><a class="indexterm" name="id2513174"></a><i class="parameter"><tt>
					
				browseable = No</tt></i></td></tr><tr><td> </td></tr><tr><td><i class="parameter"><tt>[print$]</tt></i></td></tr><tr><td><a class="indexterm" name="id2513198"></a><i class="parameter"><tt>
					
				comment = Printer Drivers Share</tt></i></td></tr><tr><td><a class="indexterm" name="id2513215"></a><i class="parameter"><tt>
					
				path = /var/lib/samba/drivers</tt></i></td></tr><tr><td><a class="indexterm" name="id2513230"></a><i class="parameter"><tt>
					
				write list = maryo, root</tt></i></td></tr><tr><td><a class="indexterm" name="id2513246"></a><i class="parameter"><tt>
					
				printer admin = maryo, root</tt></i></td></tr><tr><td># Needed to support domain logons</td></tr><tr><td> </td></tr><tr><td><i class="parameter"><tt>[netlogon]</tt></i></td></tr><tr><td><a class="indexterm" name="id2513277"></a><i class="parameter"><tt>
					
				comment = Network Logon Service</tt></i></td></tr><tr><td><a class="indexterm" name="id2513294"></a><i class="parameter"><tt>
					
				path = /var/lib/samba/netlogon</tt></i></td></tr><tr><td><a class="indexterm" name="id2513309"></a><i class="parameter"><tt>
					
				admin users = root, maryo</tt></i></td></tr><tr><td><a class="indexterm" name="id2513325"></a><i class="parameter"><tt>
					
				guest ok = Yes</tt></i></td></tr><tr><td><a class="indexterm" name="id2513340"></a><i class="parameter"><tt>
					
				browseable = No</tt></i></td></tr><tr><td># For profiles to work, create a user directory under the path</td></tr><tr><td>#  shown. i.e., mkdir -p /var/lib/samba/profiles/maryo</td></tr><tr><td> </td></tr><tr><td><i class="parameter"><tt>[Profiles]</tt></i></td></tr><tr><td><a class="indexterm" name="id2513379"></a><i class="parameter"><tt>
					
				comment = Roaming Profile Share</tt></i></td></tr><tr><td><a class="indexterm" name="id2513396"></a><i class="parameter"><tt>
					
				path = /var/lib/samba/profiles</tt></i></td></tr><tr><td><a class="indexterm" name="id2513411"></a><i class="parameter"><tt>
					
				read only = No</tt></i></td></tr><tr><td><a class="indexterm" name="id2513427"></a><i class="parameter"><tt>
					
				profile acls = Yes</tt></i></td></tr><tr><td># Other resource (share/printer) definitions would follow below.</td></tr><tr><td>...</td></tr></table></div><p>
			</p></li><li><p>
			Create UNIX group accounts as needed using a suitable operating system tool:
</p><pre class="screen">
<tt class="prompt">root# </tt><b class="userinput"><tt>groupadd ntadmins</tt></b>
<tt class="prompt">root# </tt><b class="userinput"><tt>groupadd designers</tt></b>
<tt class="prompt">root# </tt><b class="userinput"><tt>groupadd engineers</tt></b>
<tt class="prompt">root# </tt><b class="userinput"><tt>groupadd qateam</tt></b>
</pre><p>
			</p></li><li><p>
			Create user accounts on the system using the appropriate tool
			provided with the operating system. Make sure all user home directories
			are created also. Add users to groups as required for access control
			on files, directories, printers, and as required for use in the Samba
			environment.
			</p></li><li><p>
<a class="indexterm" name="id2513527"></a>
<a class="indexterm" name="id2513536"></a>
			Assign each of the UNIX groups to NT groups:
			(It may be useful to copy this text to a shell script called
			<tt class="filename">initGroups.sh</tt>.)
			
				<font color="red">&lt;title&gt;Shell script for initializing group mappings&lt;/title&gt;</font>
			</p><pre class="programlisting">
#!/bin/bash
#### Keep this as a shell script for future re-use
			
# First assign well known groups
net groupmap modify ntgroup="Domain Admins" unixgroup=ntadmins rid=512
net groupmap modify ntgroup="Domain Users"  unixgroup=users    rid=513
net groupmap modify ntgroup="Domain Guests" unixgroup=nobody   rid=514

# Now for our added Domain Groups
net groupmap add ntgroup="Designers" unixgroup=designers type=d rid=1112
net groupmap add ntgroup="Engineers" unixgroup=engineers type=d rid=1113
net groupmap add ntgroup="QA Team"   unixgroup=qateam    type=d rid=1114
</pre><p>

			</p></li><li><p>
			Create the <tt class="filename">scripts</tt> directory for use in the 
			<i class="parameter"><tt>[NETLOGON]</tt></i> share:
</p><pre class="screen">
<tt class="prompt">root# </tt><b class="userinput"><tt>mkdir -p /var/lib/samba/netlogon/scripts</tt></b>
</pre><p>
			Place the logon scripts that will be used (batch or cmd scripts)
			in this directory.
			</p></li></ol></div><p>
		The above configuration provides a functional Primary Domain Control (PDC)
		system to which must be added file shares and printers as required.
		</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2513617"></a>A Big Organization</h4></div></div><div></div></div><p>
		In this section we finally get to review in brief a Samba-3 configuration that
		uses a Light Weight Directory Access (LDAP)-based authentication backend. The
		main reasons for this choice are to provide the ability to host primary
		and Backup Domain Control (BDC), as well as to enable a higher degree of
		scalability to meet the needs of a very distributed environment.
		</p><div class="sect4" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="id2513632"></a>The Primary Domain Controller</h5></div></div><div></div></div><p>
			This is an example of a minimal configuration to run a Samba-3 PDC
			using an LDAP authentication backend. It is assumed that the operating system
			has been correctly configured.
			</p><p>
			The Idealx scripts (or equivalent) are needed to manage LDAP based Posix and/or
			SambaSamAccounts. The Idealx scripts may be downloaded from the <a href="http://www.idealx.org" target="_top">
			Idealx</a> Web site. They may also be obtained from the Samba tarball. Linux
			distributions tend to install the Idealx scripts in the 
			<tt class="filename">/usr/share/doc/packages/sambaXXXXXX/examples/LDAP/smbldap-tools</tt> directory.
			Idealx scripts version <tt class="constant">smbldap-tools-0.8.2</tt> are known to work well.
			</p><div class="procedure"><ol type="1"><li><p>
				Obtain from the Samba sources <tt class="filename">~/examples/LDAP/samba.schema</tt>
				and copy it to the <tt class="filename">/etc/openldap/schema/</tt> directory.
				</p></li><li><p>
				Set up the LDAP server. This example is suitable for OpenLDAP 2.1.x.
				The <tt class="filename">/etc/openldap/slapd.conf</tt> file:
<a class="indexterm" name="id2513707"></a>
<font color="red">&lt;title&gt;Example slapd.conf file&lt;/title&gt;</font>
</p><pre class="programlisting">
# Note commented out lines have been removed
include         /etc/openldap/schema/core.schema
include         /etc/openldap/schema/cosine.schema
include         /etc/openldap/schema/inetorgperson.schema
include         /etc/openldap/schema/nis.schema
include         /etc/openldap/schema/samba.schema

pidfile         /var/run/slapd/slapd.pid
argsfile        /var/run/slapd/slapd.args

database        bdb
suffix          "dc=quenya,dc=org"
rootdn          "cn=Manager,dc=quenya,dc=org"
rootpw          {SSHA}06qDkonA8hk6W6SSnRzWj0/pBcU3m0/P
# The password for the above is 'nastyon3'

directory     /var/lib/ldap

index   objectClass     eq
index cn                      pres,sub,eq
index sn                      pres,sub,eq
index uid                     pres,sub,eq
index displayName             pres,sub,eq
index uidNumber               eq
index gidNumber               eq
index memberUid               eq
index   sambaSID              eq
index   sambaPrimaryGroupSID  eq
index   sambaDomainName       eq
index   default               sub
</pre><p>

				</p></li><li><p>
				Create the following file <tt class="filename">samba-ldap-init.ldif</tt>:
				<a class="indexterm" name="id2513754"></a>
				
</p><pre class="programlisting">
# Organization for SambaXP Demo
dn: dc=quenya,dc=org
objectclass: dcObject
objectclass: organization
dc: quenya
o: SambaXP Demo
description: The SambaXP Demo LDAP Tree

# Organizational Role for Directory Management
dn: cn=Manager,dc=quenya,dc=org
objectclass: organizationalRole
cn: Manager
description: Directory Manager

# Setting up the container for users
dn: ou=People, dc=quenya, dc=org
objectclass: top
objectclass: organizationalUnit
ou: People

# Set up an admin handle for People OU
dn: cn=admin, ou=People, dc=quenya, dc=org
cn: admin
objectclass: top
objectclass: organizationalRole
objectclass: simpleSecurityObject
userPassword: {SSHA}0jBHgQ1vp4EDX2rEMMfIudvRMJoGwjVb
# The password for above is 'mordonL8'
</pre><p>

				</p></li><li><p>
				Load the initial data above into the LDAP database:
</p><pre class="screen">
<tt class="prompt">root# </tt><b class="userinput"><tt>slapadd -v -l initdb.ldif</tt></b>
</pre><p>
				</p></li><li><p>
				Start the LDAP server using the appropriate tool or method for
				the operating system platform on which it is installed.
				</p></li><li><p>
				Install the Idealx script files in the <tt class="filename">/usr/local/sbin</tt> directory,
				then configure the smbldap_conf.pm file to match your system configuration.
				</p></li><li><p>
				The <tt class="filename">smb.conf</tt> file that drives this backend can be found in example <a href="FastStart.html#fast-ldap" title="Example 2.9. LDAP backend smb.conf for PDC">???</a>.
				</p><p>
</p><div class="example"><a name="fast-ldap"></a><p class="title"><b>Example 2.9. LDAP backend smb.conf for PDC</b></p><table class="simplelist" border="0" summary="Simple list"><tr><td># Global parameters</td></tr><tr><td> </td></tr><tr><td><i class="parameter"><tt>[global]</tt></i></td></tr><tr><td><a class="indexterm" name="id2513879"></a><i class="parameter"><tt>
					
				workgroup = MIDEARTH</tt></i></td></tr><tr><td><a class="indexterm" name="id2513895"></a><i class="parameter"><tt>
					
				netbios name = FRODO</tt></i></td></tr><tr><td><a class="indexterm" name="id2513910"></a><i class="parameter"><tt>
					
				passdb backend = ldapsam:ldap://localhost</tt></i></td></tr><tr><td><a class="indexterm" name="id2513927"></a><i class="parameter"><tt>
					
				username map = /etc/samba/smbusers</tt></i></td></tr><tr><td><a class="indexterm" name="id2513943"></a><i class="parameter"><tt>
					
				printcap name = cups</tt></i></td></tr><tr><td><a class="indexterm" name="id2513958"></a><i class="parameter"><tt>
					
				add user script = /usr/local/sbin/smbldap-useradd.pl -m '%u'</tt></i></td></tr><tr><td><a class="indexterm" name="id2513976"></a><i class="parameter"><tt>
					
				delete user script = /usr/local/sbin/smbldap-userdel.pl %u</tt></i></td></tr><tr><td><a class="indexterm" name="id2513992"></a><i class="parameter"><tt>
					
				add group script = /usr/local/sbin/smbldap-groupadd.pl -p '%g'</tt></i></td></tr><tr><td><a class="indexterm" name="id2514008"></a><i class="parameter"><tt>
					
				delete group script = /usr/local/sbin/smbldap-groupdel.pl '%g'</tt></i></td></tr><tr><td><a class="indexterm" name="id2514025"></a><i class="parameter"><tt>
					
				add user to group script = /usr/local/sbin/ \</tt></i></td></tr><tr><td><i class="parameter"><tt>smbldap-groupmod.pl -m '%g' '%u'</tt></i></td></tr><tr><td><a class="indexterm" name="id2514048"></a><i class="parameter"><tt>
					
				delete user from group script = /usr/local/sbin/ \</tt></i></td></tr><tr><td><i class="parameter"><tt>smbldap-groupmod.pl -x '%g' '%u'</tt></i></td></tr><tr><td><a class="indexterm" name="id2514072"></a><i class="parameter"><tt>
					
				set primary group script = /usr/local/sbin/ \</tt></i></td></tr><tr><td><i class="parameter"><tt>smbldap-usermod.pl -g '%g' '%u'</tt></i></td></tr><tr><td><a class="indexterm" name="id2514096"></a><i class="parameter"><tt>
					
				add machine script = /usr/local/sbin/smbldap-useradd.pl -w '%u'</tt></i></td></tr><tr><td><a class="indexterm" name="id2514112"></a><i class="parameter"><tt>
					
				logon script = scripts\logon.bat</tt></i></td></tr><tr><td><a class="indexterm" name="id2514128"></a><i class="parameter"><tt>
					
				logon path = \\%L\Profiles\%U</tt></i></td></tr><tr><td><a class="indexterm" name="id2514144"></a><i class="parameter"><tt>
					
				logon drive = H:</tt></i></td></tr><tr><td><a class="indexterm" name="id2514159"></a><i class="parameter"><tt>
					
				logon home = \\%L\%U</tt></i></td></tr><tr><td><a class="indexterm" name="id2514175"></a><i class="parameter"><tt>
					
				domain logons = Yes</tt></i></td></tr><tr><td><a class="indexterm" name="id2514191"></a><i class="parameter"><tt>
					
				os level = 35</tt></i></td></tr><tr><td><a class="indexterm" name="id2514207"></a><i class="parameter"><tt>
					
				preferred master = Yes</tt></i></td></tr><tr><td><a class="indexterm" name="id2514222"></a><i class="parameter"><tt>
					
				domain master = Yes</tt></i></td></tr><tr><td><a class="indexterm" name="id2514238"></a><i class="parameter"><tt>
					
				ldap suffix = dc=quenya,dc=org</tt></i></td></tr><tr><td><a class="indexterm" name="id2514254"></a><i class="parameter"><tt>
					
				ldap machine suffix = ou=People</tt></i></td></tr><tr><td><a class="indexterm" name="id2514271"></a><i class="parameter"><tt>
					
				ldap user suffix = ou=People</tt></i></td></tr><tr><td><a class="indexterm" name="id2514286"></a><i class="parameter"><tt>
					
				ldap group suffix = ou=People</tt></i></td></tr><tr><td><a class="indexterm" name="id2514302"></a><i class="parameter"><tt>
					
				ldap idmap suffix = ou=People</tt></i></td></tr><tr><td><a class="indexterm" name="id2514318"></a><i class="parameter"><tt>
					
				ldap admin dn = cn=Manager</tt></i></td></tr><tr><td><a class="indexterm" name="id2514333"></a><i class="parameter"><tt>
					
				ldap ssl = no</tt></i></td></tr><tr><td><a class="indexterm" name="id2514349"></a><i class="parameter"><tt>
					
				ldap passwd sync = Yes</tt></i></td></tr><tr><td><a class="indexterm" name="id2514365"></a><i class="parameter"><tt>
					
				idmap uid = 15000-20000</tt></i></td></tr><tr><td><a class="indexterm" name="id2514380"></a><i class="parameter"><tt>
					
				idmap gid = 15000-20000</tt></i></td></tr><tr><td><a class="indexterm" name="id2514396"></a><i class="parameter"><tt>
					
				printing = cups</tt></i></td></tr><tr><td>...</td></tr></table></div><p>
				</p></li><li><p>
				Add the LDAP password to the <tt class="filename">secrets.tdc</tt> file so Samba can update
				the LDAP database:
</p><pre class="screen">
<tt class="prompt">root# </tt><b class="userinput"><tt>smbpasswd -w mordonL8</tt></b>
</pre><p>
				</p></li><li><p>
				Add users and groups as required. Users and groups added using Samba tools
				will automatically be added to both the LDAP backend as well as to the operating
				system as required.
				</p></li></ol></div></div><div class="sect4" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="id2514458"></a>Backup Domain Controller</h5></div></div><div></div></div><p>
			<a href="FastStart.html#fast-bdc" title="Example 2.10. Remote LDAP BDC smb.conf">???</a> shows the example configuration for the BDC.
			</p><div class="procedure"><ol type="1"><li><p>
				Decide if the BDC should have its own LDAP server or not. If the BDC is to be
				the LDAP server change the following <tt class="filename">smb.conf</tt> as indicated. The default
				configuration in <a href="FastStart.html#fast-bdc" title="Example 2.10. Remote LDAP BDC smb.conf">???</a> uses a central LDAP server.
</p><div class="example"><a name="fast-bdc"></a><p class="title"><b>Example 2.10. Remote LDAP BDC smb.conf</b></p><table class="simplelist" border="0" summary="Simple list"><tr><td># Global parameters</td></tr><tr><td> </td></tr><tr><td><i class="parameter"><tt>[global]</tt></i></td></tr><tr><td><a class="indexterm" name="id2514525"></a><i class="parameter"><tt>
					
				workgroup = MIDEARTH</tt></i></td></tr><tr><td><a class="indexterm" name="id2514541"></a><i class="parameter"><tt>
					
				netbios name = GANDALF</tt></i></td></tr><tr><td><a class="indexterm" name="id2514556"></a><i class="parameter"><tt>
					
				passdb backend = ldapsam:ldap://frodo.quenya.org</tt></i></td></tr><tr><td><a class="indexterm" name="id2514573"></a><i class="parameter"><tt>
					
				username map = /etc/samba/smbusers</tt></i></td></tr><tr><td><a class="indexterm" name="id2514589"></a><i class="parameter"><tt>
					
				printcap name = cups</tt></i></td></tr><tr><td><a class="indexterm" name="id2514605"></a><i class="parameter"><tt>
					
				logon script = scripts\logon.bat</tt></i></td></tr><tr><td><a class="indexterm" name="id2514621"></a><i class="parameter"><tt>
					
				logon path = \\%L\Profiles\%U</tt></i></td></tr><tr><td><a class="indexterm" name="id2514636"></a><i class="parameter"><tt>
					
				logon drive = H:</tt></i></td></tr><tr><td><a class="indexterm" name="id2514652"></a><i class="parameter"><tt>
					
				logon home = \\%L\%U</tt></i></td></tr><tr><td><a class="indexterm" name="id2514668"></a><i class="parameter"><tt>
					
				domain logons = Yes</tt></i></td></tr><tr><td><a class="indexterm" name="id2514684"></a><i class="parameter"><tt>
					
				os level = 33</tt></i></td></tr><tr><td><a class="indexterm" name="id2514700"></a><i class="parameter"><tt>
					
				preferred master = Yes</tt></i></td></tr><tr><td><a class="indexterm" name="id2514715"></a><i class="parameter"><tt>
					
				domain master = No</tt></i></td></tr><tr><td><a class="indexterm" name="id2514731"></a><i class="parameter"><tt>
					
				ldap suffix = dc=quenya,dc=org</tt></i></td></tr><tr><td><a class="indexterm" name="id2514747"></a><i class="parameter"><tt>
					
				ldap machine suffix = ou=People</tt></i></td></tr><tr><td><a class="indexterm" name="id2514763"></a><i class="parameter"><tt>
					
				ldap user suffix = ou=People</tt></i></td></tr><tr><td><a class="indexterm" name="id2514779"></a><i class="parameter"><tt>
					
				ldap group suffix = ou=People</tt></i></td></tr><tr><td><a class="indexterm" name="id2514794"></a><i class="parameter"><tt>
					
				ldap idmap suffix = ou=People</tt></i></td></tr><tr><td><a class="indexterm" name="id2514810"></a><i class="parameter"><tt>
					
				ldap admin dn = cn=Manager</tt></i></td></tr><tr><td><a class="indexterm" name="id2514826"></a><i class="parameter"><tt>
					
				ldap ssl = no</tt></i></td></tr><tr><td><a class="indexterm" name="id2514842"></a><i class="parameter"><tt>
					
				ldap passwd sync = Yes</tt></i></td></tr><tr><td><a class="indexterm" name="id2514858"></a><i class="parameter"><tt>
					
				idmap uid = 15000-20000</tt></i></td></tr><tr><td><a class="indexterm" name="id2514873"></a><i class="parameter"><tt>
					
				idmap gid = 15000-20000</tt></i></td></tr><tr><td><a class="indexterm" name="id2514889"></a><i class="parameter"><tt>
					
				printing = cups</tt></i></td></tr><tr><td>...</td></tr></table></div><p>
				</p></li><li><p>
				Configure the NETLOGON and PROFILES directory as for the PDC in <a href="FastStart.html#fast-bdc" title="Example 2.10. Remote LDAP BDC smb.conf">???</a>.
				</p></li></ol></div></div></div></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="install.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="introduction.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="type.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 1. How to Install and Test SAMBA </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Part II. Server Configuration Basics</td></tr></table></div></body></html>