This commit was manufactured by cvs2svn to create branch 'SAMBA_3_0'.(This used to...
[samba.git] / docs / htmldocs / using_samba / ch04_04.html
1 <HTML>
2 <HEAD>
3 <TITLE>
4 [Chapter 4] 4.4 Server Configuration</title><META NAME="DC.title" CONTENT=""><META NAME="DC.creator" CONTENT=""><META NAME="DC.publisher" CONTENT="O'Reilly &amp; Associates, Inc."><META NAME="DC.date" CONTENT="1999-11-05T21:32:07Z"><META NAME="DC.type" CONTENT="Text.Monograph"><META NAME="DC.format" CONTENT="text/html" SCHEME="MIME"><META NAME="DC.source" CONTENT="" SCHEME="ISBN"><META NAME="DC.language" CONTENT="en-US"><META NAME="generator" CONTENT="Jade 1.1/O'Reilly DocBook 3.0 to HTML 4.0"></head>
5 <BODY BGCOLOR="#FFFFFF" TEXT="#000000" link="#990000" vlink="#0000CC">
6 <table BORDER="0" CELLPADDING="0" CELLSPACING="0" width="90%">
7 <tr>
8 <td width="25%" valign="TOP">
9 <img hspace=10 vspace=10 src="gifs/samba.s.gif" 
10 alt="Using Samba" align=left valign=top border=0>
11 </td>
12 <td height="105" valign="TOP">
13 <br>
14 <H2>Using Samba</H2>
15 <font size="-1">
16 Robert Eckstein, David Collier-Brown, Peter Kelly
17 <br>1st Edition November 1999
18 <br>1-56592-449-5, Order Number: 4495
19 <br>416 pages, $34.95
20 </font>
21 <p> <a href="http://www.oreilly.com/catalog/samba/">Buy the hardcopy</a>
22 <p><a href="index.html">Table of Contents</a>
23 </td>
24 </tr>
25 </table>
26 <hr size=1 noshade>
27 <!--sample chapter begins -->
28
29 <center>
30 <DIV CLASS="htmlnav">
31 <TABLE WIDTH="515" BORDER="0" CELLSPACING="0" CELLPADDING="0">
32 <TR>
33 <TD ALIGN="LEFT" VALIGN="TOP" WIDTH="172">
34 <A CLASS="sect1" HREF="ch04_03.html" TITLE="4.3 Configuration File Options">
35 <IMG SRC="gifs/txtpreva.gif" ALT="Previous: 4.3 Configuration File Options" BORDER="0"></a></td><TD ALIGN="CENTER" VALIGN="TOP" WIDTH="171">
36 <B>
37 <FONT FACE="ARIEL,HELVETICA,HELV,SANSERIF" SIZE="-1">
38 <A CLASS="chapter" REL="up" HREF="ch04_01.html" TITLE="4. Disk Shares ">
39 Chapter 4<br>
40 Disk Shares </a></font></b></td><TD ALIGN="RIGHT" VALIGN="TOP" WIDTH="172">
41 <A CLASS="sect1" HREF="ch04_05.html" TITLE="4.5 Disk Share Configuration">
42 <IMG SRC="gifs/txtnexta.gif" ALT="Next: 4.5 Disk Share Configuration" BORDER="0"></a></td></tr></table>&nbsp;<hr noshade size=1></center>
43 </div>
44 <blockquote>
45 <div>
46 <H2 CLASS="sect1">
47 <A CLASS="title" NAME="ch04-71382">
48 4.4 Server Configuration</a></h2><P CLASS="para">Now it's time to begin configuring your Samba server. Let's introduce three basic configuration options that can appear in the <CODE CLASS="literal">
49 [global]</code> section of your <I CLASS="filename">
50 smb.conf</i> file:</p><PRE CLASS="programlisting">
51 [global]
52         #  Server configuration parameters
53         netbios name = HYDRA
54         server string = Samba %v on (%L)
55         workgroup = SIMPLE</pre><P CLASS="para">
56 This configuration file is pretty simple; it advertises the Samba server on a NBT network under the NetBIOS name <CODE CLASS="literal">
57 hydra</code>. In addition, the machine belongs to the workgroup SIMPLE and displays a description to clients that includes the Samba version number as well as the NetBIOS name of the Samba server.</p><P CLASS="para">
58 If you had to enter <CODE CLASS="literal">
59 encrypt passwords=yes </code>in your earlier configuration file, you should do so here as well.</p><P CLASS="para">
60 Go ahead and try this configuration file. Create a file named <I CLASS="filename">
61 smb.conf</i> under the <I CLASS="filename">
62 /usr/local/samba/lib</i> directory with the text listed above. Then reset the Samba server and use a Windows client to verify the results. Be sure that your Windows clients are in the SIMPLE workgroup as well. After clicking on the Network Neighborhood on a Windows client, you should see a window similar to <A CLASS="xref" HREF="ch04_04.html#ch04-38915">
63 Figure 4.2</a>. (In this figure, <CODE CLASS="literal">
64 phoenix</code> and <CODE CLASS="literal">
65 chimaera</code> are our Windows clients.) </p><H4 CLASS="figure">
66 <A CLASS="title" NAME="ch04-38915">
67 Figure 4.2: Network Neighborhood showing the Samba server</a></h4><IMG CLASS="graphic" SRC="figs/sam.0402.gif" ALT="Figure 4.2"><P CLASS="para">
68 You can verify the <CODE CLASS="literal">
69 server</code> <CODE CLASS="literal">
70 string</code> by listing the details of the Network Neighborhood window (select the Details menu item under the View menu), at which point you should see a window similar to <A CLASS="xref" HREF="ch04_04.html#ch04-50900">
71 Figure 4.3</a>. </p><H4 CLASS="figure">
72 <A CLASS="title" NAME="ch04-50900">
73 Figure 4.3: Network Neighborhood details listing</a></h4><IMG CLASS="graphic" SRC="figs/sam.0403.gif" ALT="Figure 4.3"><P CLASS="para">
74 If you were to click on the Hydra icon, a window should appear that shows the services that it provides. In this case, the window would be completely empty because there are no shares on the server yet.</p><DIV CLASS="sect2">
75 <H3 CLASS="sect2">
76 <A CLASS="title" NAME="ch04-pgfId-961293">
77 4.4.1 Server Configuration Options</a></h3><P CLASS="para">
78 <A CLASS="xref" HREF="ch04_04.html#ch04-61150">Table 4.3</a> summarizes the server configuration options introduced previously. Note that all three of these options are global in scope; in other words, they must appear in the <CODE CLASS="literal">
79 [global]</code> section of the configuration file. </p><br>
80 <TABLE CLASS="table" BORDER="1" CELLPADDING="3">
81 <CAPTION CLASS="table">
82 <A CLASS="title" NAME="ch04-61150">
83 Table 4.3: Server Configuration Options </a></caption><THEAD CLASS="thead">
84 <TR CLASS="row" VALIGN="TOP">
85 <TH CLASS="entry" ALIGN="LEFT" ROWSPAN="1" COLSPAN="1">
86 <P CLASS="para">
87 Option</p></th><TH CLASS="entry" ALIGN="LEFT" ROWSPAN="1" COLSPAN="1">
88 <P CLASS="para">
89 Parameters</p></th><TH CLASS="entry" ALIGN="LEFT" ROWSPAN="1" COLSPAN="1">
90 <P CLASS="para">
91 Function</p></th><TH CLASS="entry" ALIGN="LEFT" ROWSPAN="1" COLSPAN="1">
92 <P CLASS="para">
93 Default</p></th><TH CLASS="entry" ALIGN="LEFT" ROWSPAN="1" COLSPAN="1">
94 <P CLASS="para">
95 Scope</p></th></tr></thead><TBODY CLASS="tbody">
96 <TR CLASS="row" VALIGN="TOP">
97 <TD CLASS="entry" ROWSPAN="1" COLSPAN="1">
98 <P CLASS="para">
99 <CODE CLASS="literal">
100 netbios name</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1">
101 <P CLASS="para">
102 string</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1">
103 <P CLASS="para">
104 Sets the primary NetBIOS name of the Samba server.</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1">
105 <P CLASS="para">
106 Server DNS hostname</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1">
107 <P CLASS="para">
108 Global</p></td></tr><TR CLASS="row" VALIGN="TOP">
109 <TD CLASS="entry" ROWSPAN="1" COLSPAN="1">
110 <P CLASS="para">
111 <CODE CLASS="literal">
112 server string</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1">
113 <P CLASS="para">
114 string</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1">
115 <P CLASS="para">
116 Sets a descriptive string for the Samba server.</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1">
117 <P CLASS="para">
118 <CODE CLASS="literal">
119 Samba %v</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1">
120 <P CLASS="para">
121 Global</p></td></tr><TR CLASS="row" VALIGN="TOP">
122 <TD CLASS="entry" ROWSPAN="1" COLSPAN="1">
123 <P CLASS="para">
124 <CODE CLASS="literal">
125 workgroup</code></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1">
126 <P CLASS="para">
127 string</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1">
128 <P CLASS="para">
129 Sets the NetBIOS group of machines that the server belongs to.</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1">
130 <P CLASS="para">
131 Defined at compile time</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1">
132 <P CLASS="para">
133 Global</p></td></tr></tbody></table><DIV CLASS="sect3">
134 <H4 CLASS="sect3">
135 <A CLASS="title" NAME="ch04-pgfId-955762">
136 4.4.1.1 netbios name</a></h4><P CLASS="para">
137 The <CODE CLASS="literal">
138 netbios</code> <CODE CLASS="literal">
139 name</code> option allows you to set the NetBIOS name of the server. For example:</p><PRE CLASS="programlisting">
140 netbios name = YORKVM1</pre><P CLASS="para">
141 The default value for this configuration option is the server's hostname; that is, the first part of its complete DNS machine name. For example, a machine with the DNS name <CODE CLASS="literal">
142 ruby.ora.com</code> would be given the NetBIOS name <CODE CLASS="literal">
143 RUBY</code> by default. While you can use this option to restate the machine's NetBIOS name in the configuration file (as we did previously), it is more commonly used to assign the Samba server a NetBIOS name other than its current DNS name. Remember that the name given must follow the rules for valid NetBIOS machine names as outlines in <a href="ch01_01.html"><b>Chapter 1, <CITE CLASS="chapter">Learning the Samba</cite></b></a>.</p><P CLASS="para">
144 Changing the NetBIOS name of the server is not recommended unless you have a good reason. One such reason might be if the hostname of the machine is not unique because the LAN is divided over two or more DNS domains. For example, YORKVM1 is a good NetBIOS candidate for <i>vm1.york.example.com</i> to differentiate it from <EM CLASS="emphasis">
145 vm1.falkirk.example.com</em>, which has the same hostname but resides in a different DNS domain.</p><P CLASS="para">
146 Another use of this option is for relocating SMB services from a dead or retired machine. For example, if <CODE CLASS="literal">
147 SALES</code> is the SMB server for the department, and it suddenly dies, you could immediately reset <CODE CLASS="literal">
148 netbios</code> <CODE CLASS="literal">
149 name</code> <CODE CLASS="literal">
150 =</code> <CODE CLASS="literal">
151 SALES</code> on a backup Samba machine that's taking over for it. Users won't have to change their drive mappings to a different machine; new connections to <CODE CLASS="literal">
152 SALES</code> will simply go to the new machine.</p></div><DIV CLASS="sect3">
153 <H4 CLASS="sect3">
154 <A CLASS="title" NAME="ch04-pgfId-955977">
155 4.4.1.2 server string</a></h4><P CLASS="para">
156 The <CODE CLASS="literal">
157 server</code> <CODE CLASS="literal">
158 string</code> parameter defines a comment string that will appear next to the server name in both the Network Neighborhood (when shown with the Details menu) and the comment entry of the Microsoft Windows print manager. You can use the standard variables to provide information in the description. For example, our entry earlier was:</p><PRE CLASS="programlisting">
159 [global]
160         server string = Samba %v on (%h)</pre><P CLASS="para">
161 The default for this option simply presents the current version of Samba and is equivalent to:</p><PRE CLASS="programlisting">
162 server string = Samba %v</pre></div><DIV CLASS="sect3">
163 <H4 CLASS="sect3">
164 <A CLASS="title" NAME="ch04-pgfId-955973">
165 4.4.1.3 workgroup</a></h4><P CLASS="para">
166 The <CODE CLASS="literal">
167 workgroup</code> parameter sets the current workgroup where the Samba server will advertise itself. Clients that wish to access shares on the Samba server should be on the same NetBIOS workgroup. Remember that workgroups are really just NetBIOS group names, and must follow the standard NetBIOS naming conventions outlined in <a href="ch01_01.html"><b>Chapter 1</b></a>. For example:</p><PRE CLASS="programlisting">
168 [global]
169         workgroup = SIMPLE</pre><P CLASS="para">
170 The default option for this parameter is set at compile time. If the entry is not changed in the makefile, it will be <CODE CLASS="literal">
171 WORKGROUP</code>. Because this tends to be the workgroup name of every unconfigured NetBIOS network, we recommend that you always set your workgroup name in the Samba configuration file.[<A CLASS="footnote" HREF="#ch04-pgfId-962322">2</a>] </p><BLOCKQUOTE CLASS="footnote">
172 <DIV CLASS="footnote">
173 <P CLASS="para">
174 <A CLASS="footnote" NAME="ch04-pgfId-962322">[2]</a> We should also mention that it is an inherently bad idea to have a workgroup that shares the same name as a server.</p></div></blockquote></div></div></div></blockquote>
175 <div>
176 <center>
177 <hr noshade size=1><TABLE WIDTH="515" BORDER="0" CELLSPACING="0" CELLPADDING="0">
178 <TR>
179 <TD ALIGN="LEFT" VALIGN="TOP" WIDTH="172">
180 <A CLASS="sect1" HREF="ch04_03.html" TITLE="4.3 Configuration File Options">
181 <IMG SRC="gifs/txtpreva.gif" ALT="Previous: 4.3 Configuration File Options" BORDER="0"></a></td><TD ALIGN="CENTER" VALIGN="TOP" WIDTH="171">
182 <A CLASS="book" HREF="index.html" TITLE="">
183 <IMG SRC="gifs/txthome.gif" ALT="" BORDER="0"></a></td><TD ALIGN="RIGHT" VALIGN="TOP" WIDTH="172">
184 <A CLASS="sect1" HREF="ch04_05.html" TITLE="4.5 Disk Share Configuration">
185 <IMG SRC="gifs/txtnexta.gif" ALT="Next: 4.5 Disk Share Configuration" BORDER="0"></a></td></tr><TR>
186 <TD ALIGN="LEFT" VALIGN="TOP" WIDTH="172">
187 4.3 Configuration File Options</td><TD ALIGN="CENTER" VALIGN="TOP" WIDTH="171">
188 <A CLASS="index" HREF="inx.html" TITLE="Book Index">
189 <IMG SRC="gifs/index.gif" ALT="Book Index" BORDER="0"></a></td><TD ALIGN="RIGHT" VALIGN="TOP" WIDTH="172">
190 4.5 Disk Share Configuration</td></tr></table><hr noshade size=1></center>
191 </div>
192
193 <!-- End of sample chapter -->
194 <CENTER>
195 <FONT SIZE="1" FACE="Verdana, Arial, Helvetica">
196 <A HREF="http://www.oreilly.com/">
197 <B>O'Reilly Home</B></A> <B> | </B>
198 <A HREF="http://www.oreilly.com/sales/bookstores">
199 <B>O'Reilly Bookstores</B></A> <B> | </B>
200 <A HREF="http://www.oreilly.com/order_new/">
201 <B>How to Order</B></A> <B> | </B>
202 <A HREF="http://www.oreilly.com/oreilly/contact.html">
203 <B>O'Reilly Contacts<BR></B></A>
204 <A HREF="http://www.oreilly.com/international/">
205 <B>International</B></A> <B> | </B>
206 <A HREF="http://www.oreilly.com/oreilly/about.html">
207 <B>About O'Reilly</B></A> <B> | </B>
208 <A HREF="http://www.oreilly.com/affiliates.html">
209 <B>Affiliated Companies</B></A><p>
210 <EM>&copy; 1999, O'Reilly &amp; Associates, Inc.</EM>
211 </FONT>
212 </CENTER>
213 </BODY>
214 </html>