Large number of small fixes to the layout and the build system.
[Samba.git] / docs / Samba3-HOWTO / TOSHARG-Install.xml
blob1cec899cdde93c9528996152ae3b99e4965c0d11
1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <!DOCTYPE chapter PUBLIC "-//Samba-Team//DTD DocBook V4.2-Based Variant V1.0//EN" "http://www.samba.org/samba/DTD/samba-doc">
3 <chapter id="install">
4 <chapterinfo>
5         &author.tridge;
6         &author.jelmer;
7         &author.jht;
8         &author.kauer;
9         &author.danshearer;
10         <!-- Isn't some of this written by others as well? -->
12 </chapterinfo>
14 <title>How to Install and Test SAMBA</title>
16 <sect1>
17         <title>Obtaining and Installing Samba</title>
19         <para>
20         Binary packages of Samba are included in almost any Linux or
21         UNIX distribution. There are also some packages available at 
22         <ulink url="http://samba.org/">the Samba home-page</ulink>. Refer to 
23         the manual of your operating system for details on installing packages 
24         for your specific operating system.
25         </para>
27         <para>If you need to compile Samba from source, check 
28         <link linkend="compiling">How to compile Samba.</link>
29         </para>
31 </sect1>
33 <sect1>
34         <title>Configuring Samba (smb.conf)</title>
36         <para>
37         Samba's configuration is stored in the &smb.conf; file, which
38         usually resides in <filename>/etc/samba/smb.conf</filename> 
39         or <filename>/usr/local/samba/lib/smb.conf</filename>. You can either 
40         edit this file yourself or do it using one of the many graphical 
41         tools that are available, such as the Web-based interface SWAT, that 
42         is included with Samba.
43         </para>
45         <sect2>
46         <title>Configuration file syntax</title>
48         <para>The &smb.conf; file uses the same syntax as the various old 
49         .ini files in Windows 3.1: Each file consists of various sections, 
50         which are started by putting the section name between brackets ([]) 
51         on a new line. Each contains zero or more key/value-pairs separated by an 
52         equality sign (=). The file is just a plain-text file, so you can 
53         open and edit it with your favorite editing tool.</para>
55         <para>Each section in the &smb.conf; file represents a share 
56         on the Samba server. The section <quote>global</quote> is special, since it 
57         contains settings that apply to the whole Samba server and not 
58         to one share in particular.</para>
60 <para><link linkend="smbconfminimal">Following example</link> contains a very minimal &smb.conf;.
61         <indexterm><primary>minimal configuration</primary></indexterm>
62 </para>
64         <smbconfexample id="smbconfminimal">
65                 <title>A minimal smb.conf</title>
67                 <smbconfsection name="[global]"/>
68                 <smbconfoption name="workgroup">WKG</smbconfoption>
69                 <smbconfoption name="netbios name">MYNAME</smbconfoption>
70                 <smbconfsection name="[share1]"/>
71                 <smbconfoption name="path">/tmp</smbconfoption>
73                 <smbconfsection name="[share2]"/>
74                 <smbconfoption name="path">/my_shared_folder</smbconfoption>
75                 <smbconfoption name="comment">Some random files</smbconfoption>
76         </smbconfexample>
78 </sect2>
80 <sect2>
81         <title>Starting Samba</title>
83         <para>
84         Samba essentially consists of two or three daemons. A daemon is a UNIX application that runs in the background and provides services.
85         An example of a service is the Apache Web server for which the daemon is called <command>httpd</command>. In the case of Samba there
86         are three daemons, two of which are needed as a minimum.
87         </para>
89         <para>
90         The Samba server is made up of the following daemons:
91         </para>
93         <variablelist>
94                 <varlistentry><term>nmbd</term>
95                         <listitem><para>
96                         <indexterm><primary>smbd</primary></indexterm>
97                         <indexterm><primary>starting samba</primary><secondary>smbd</secondary></indexterm>
98                         This daemon handles all name registration and resolution requests. It is the primary vehicle involved
99                         in network browsing. It handles all UDP based protocols. The <command>nmbd</command> daemon should
100                         be the first command started as part of the Samba start-up process.
101                         </para></listitem>
102                 </varlistentry>
104                 <varlistentry><term>smbd</term>
105                         <listitem><para>
106                         <indexterm><primary>nmbd</primary></indexterm>
107                         <indexterm><primary>starting samba</primary><secondary>nmbd</secondary></indexterm>
108                         This daemon handles all TCP/IP based connection services for file and print based operations. It also
109                         manages local authentication. It should be started immediately following the start-up of <command>nmbd</command>.
110                         </para></listitem>
111                 </varlistentry>
113                 <varlistentry><term>winbindd</term>
114                         <listitem><para>
115                         <indexterm><primary>winbindd</primary></indexterm>
116                         <indexterm><primary>starting samba</primary><secondary>winbindd</secondary></indexterm>
117                         This daemon should be started when Samba is a member of a Windows NT4 or ADS Domain. It is also needed when
118                         Samba has trust relationships with another Domain. The <command>winbindd</command> daemon will check the
119                         &smb.conf; file for the presence of the <parameter>idmap uid</parameter> and <parameter>idmap gid</parameter>
120                         parameters. If they are not found <command>winbindd</command> will bail-out and refuse to start.
121                         </para></listitem>
122                 </varlistentry>
123         </variablelist>
125         <para>
126         When Samba has been packaged by an operating system vendor the start-up process is typically a custom feature of its
127         integration into the platform as a whole. Please refer to your operating system platform administration manuals for
128         specific information pertaining to correct management of Samba start-up.
129         </para>
131 </sect2>
132         
133 <sect2>
134         <title>Example Configuration</title>
135         
136         <para>
137         There are sample configuration files in the examples subdirectory in the
138         distribution. It is suggested you read them carefully so you can see how the options
139         go together in practice. See the man page for all the options. 
140         It might be worthwhile to start out with the smb.conf.default 
141         configuration file and adapt it to your needs. It contains plenty of 
142         comments.
143         </para>
145         <para>
146         The simplest useful configuration file would contain something like shown in
147         <link linkend="simple-example">the next example</link>.
148         </para>
150         <para>
151         <indexterm><primary>simple configuration</primary></indexterm>
152         <smbconfexample id="simple-example">
153                 <title>Another simple smb.conf File</title>
154 <smbconfsection name="[global]"/>
155 <smbconfoption name="workgroup">&example.workgroup;</smbconfoption>
157 <smbconfsection name="[homes]"/>
158 <smbconfoption name="guest ok">no</smbconfoption>
159 <smbconfoption name="read only">no</smbconfoption>
160         </smbconfexample>
161         </para>
162         
163         <para>
164         This will allow connections by anyone with an account on the server, using either
165         their login name or <smbconfsection name="homes"/> as the service name.
166         (Note: The workgroup that Samba should appear in must also be set. The default
167         workgroup name is WORKGROUP.)
168         </para>
169         
170         <para>
171         Make sure you put the &smb.conf; file in the correct place.
172         </para>
174         <para>
175         For more information about security settings for the 
176         <smbconfsection name="[homes]"/> share please refer to 
177         <link linkend="securing-samba">Securing Samba</link> chapter.
178         </para>
180 <sect3>
181         <title>Test Your Config File with <command>testparm</command></title>
183         <para>
184         It's important to validate the contents of the &smb.conf; file using the &testparm; program.
185         If testparm runs correctly, it will list the loaded services. If not, it will give an error message.
186         Make sure it runs correctly and that the services look reasonable before proceeding. Enter the command: 
187         </para>
189         <screen>
190         &rootprompt; testparm /etc/samba/smb.conf
191         </screen>
193         <para>Testparm will parse your configuration file and report 
194         any unknown parameters or incorrect syntax. </para>
196         
198         <para>
199         Always run testparm again whenever the &smb.conf; file is changed!
200         </para>
202 </sect3>
203 </sect2>
205 <sect2>
206         <title>SWAT</title>
208         <para>
209         <indexterm><primary>swat</primary></indexterm>
210         SWAT is a Web-based interface that can be used to facilitate the configuration of Samba. 
211         SWAT might not be available in the Samba package that shipped with your platform, 
212         but in a separate package. Please read the SWAT man page 
213         on compiling, installing and configuring SWAT from source.
214         </para>
216         <para>
217         To launch SWAT, just run your favorite Web browser and point it to
218         <ulink url="http://localhost:901/" noescape="1">http://localhost:901/</ulink>.
219         Replace <replaceable>localhost</replaceable> with the name of the computer on which
220         Samba is running if that is a different computer than your browser.
221         </para>
223         <para>
224         SWAT can be used from a browser on any IP-connected machine, but be aware that connecting from a remote
225         machine leaves your connection open to password sniffing as passwords will be sent over the wire in the clear. 
226         </para>
228         <para>More information about SWAT can be found in <link linkend="SWAT">corresponding chapter</link>.</para>
230 </sect2>
232 </sect1>
234 <sect1>
235         <title>List Shares Available on the Server</title>
237         <para>
238         To list shares that are available from the configured Samba server execute the
239         following command:
240         </para>
242 <para><screen>
243 &prompt;<userinput>smbclient -L <replaceable>yourhostname</replaceable></userinput>
244 </screen></para>
246         <para>You should see a list of shares available on your server. If you do not, then
247         something is incorrectly configured. This method can also be used to see what shares 
248         are available on other SMB servers, such as Windows 2000.</para>
250         <para>If you choose user-level security you may find that Samba requests a password
251         before it will list the shares. See the <command>smbclient</command> man page for details.
252         You can force it to list the shares without a password by adding the option
253         <option>-N</option> to the command line. </para>
254 </sect1>
256 <sect1>
257         <title>Connect with a UNIX Client</title>
258         
259         <para>
260         Enter the following command:
261 <screen>
262 &prompt;<userinput>smbclient <replaceable> //yourhostname/aservice</replaceable></userinput>
263 </screen></para>
264         
265         <para>Typically <replaceable>yourhostname</replaceable> is the name of the host on which &smbd;
266         has been installed. The <replaceable>aservice</replaceable> is any service that has been defined in the &smb.conf;
267         file. Try your user name if you just have a <smbconfsection name="[homes]"/> section in the &smb.conf; file.</para>
269         <para>Example: If the UNIX host is called <replaceable>bambi</replaceable> and a valid login name
270         is <replaceable>fred</replaceable>, you would type:</para>
272 <para><screen>
273 &prompt;<userinput>smbclient //<replaceable>bambi</replaceable>/<replaceable>fred</replaceable></userinput>
274 </screen></para>
275 </sect1>
277 <sect1>
278         <title>Connect from a Remote SMB Client</title>
280         <para>Now that Samba is working correctly locally, you can try to 
281         access it from other clients. Within a few minutes, the Samba host 
282         should be listed in the Network Neighborhood on all Windows 
283         clients of its subnet. Try browsing the server from another client
284         or 'mounting' it.</para>
286         <para>Mounting disks from a DOS, Windows or OS/2 client can be done by running a command such as:</para>
288         <para><screen>
289 &dosprompt;<userinput>net use d: \\servername\service</userinput>
290 </screen></para>
292         <para>Try printing, e.g.</para>
294         <para>
295 <screen>
296 &dosprompt;<userinput>net use lpt1:     \\servername\spoolservice</userinput>
297 </screen></para>
299 <para>
300 <screen>&dosprompt;<userinput>print filename</userinput>
301 </screen></para>
302 </sect1>
304 <sect1>
305         <title>What If Things Don't Work?</title>
306         
307         <para>You might want to read <link linkend="diagnosis">The Samba Checklist</link>.
308         If you are still stuck, refer to <link linkend="problems">Analyzing and Solving Samba Problems</link> chapter.
309         Samba has been successfully installed at thousands of sites worldwide.
310         It is unlikely that your particular problem is unique, so it might be
311         productive to perform an Internet search to see if someone else has encountered
312         your problem and has found a way to overcome it.</para>
314 </sect1>
316 <sect1>
317 <title>Common Errors</title>
319 <para>
320 The following questions and issues are raised repeatedly on the Samba mailing list.
321 </para>
323 <sect2>
324         <title>Large Number of smbd Processes</title>
326 <para>
327 Samba consists of three core programs: &nmbd;, &smbd;, and &winbindd;. &nmbd; is the name server message daemon,
328 &smbd; is the server message daemon, and &winbindd; is the daemon that handles communication with Domain Controllers.
329 </para>
331 <para>
332 If Samba is <emphasis>not</emphasis> running as a WINS server, then there will be one single instance of
333  &nmbd; running on your system. If it is running as a WINS server then there will be
334 two instances &smbmdash; one to handle the WINS requests.
335 </para>
337 <para>
338 &smbd; handles all connection requests. It spawns a new process for each client
339 connection made. That is why you may see so many of them, one per client connection.
340 </para>
342 <para>
343 &winbindd; will run as one or two daemons, depending on whether or not it is being
344 run in <emphasis>split mode</emphasis> (in which case there will be two instances).
345 </para>
347 </sect2>
349         <sect2>
350                 <title>Error Message: open_oplock_ipc</title>
352         <para>An error message is observed in the log files when &smbd; is started: <quote>open_oplock_ipc: Failed to get local UDP socket
353         for address 100007f. Error was Cannot assign requested.</quote></para>
355         <para>Your loopback device isn't working correctly. Make sure it is configured correctly. The loopback
356         device is an internal (virtual) network device with the IP address <emphasis>127.0.0.1</emphasis>.
357         Read your OS documentation for details on how to configure the loopback on your system.</para>
359         </sect2>
361         <sect2>
362                 <title><quote><errorname>The network name cannot be found</errorname></quote></title>
364                 <para>
365                 This error can be caused by one of these mis-configurations:
366                 </para>
368                 <itemizedlist>
369                         <listitem><para>You specified an non-existing path
370                         for the share in &smb.conf;.</para></listitem>
372                         <listitem><para>The user you are trying to access the share with does not 
373                         have sufficient permissions to access the path for
374                         the share. Both read (r) and access (x) should be possible.</para></listitem>
376                         <listitem><para>The share you are trying to access does not exist.</para></listitem>
377         </itemizedlist>
379         </sect2>
380 </sect1>
382 </chapter>