regenerate
[Samba.git] / docs / htmldocs / install.html
blob5b9d6589846a0eb276353c29d9908a5a653463d7
1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 2. How to Install and Test SAMBA</title><link rel="stylesheet" href="samba.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"><link rel="home" href="index.html" title="SAMBA Project Documentation"><link rel="up" href="introduction.html" title="Part I. General Installation"><link rel="previous" href="IntroSMB.html" title="Chapter 1. Introduction to Samba"><link rel="next" href="FastStart.html" title="Chapter 3. Fast Start for the Impatient"></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. How to Install and Test SAMBA</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="IntroSMB.html">Prev</a> </td><th width="60%" align="center">Part I. General Installation</th><td width="20%" align="right"> <a accesskey="n" href="FastStart.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="install"></a>Chapter 2. How to Install and Test SAMBA</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Andrew</span> <span class="surname">Tridgell</span></h3><div class="affiliation"><span class="orgname">Samba Team<br></span><div class="address"><p><tt class="email">&lt;<a href="mailto:tridge@samba.org">tridge@samba.org</a>&gt;</tt></p></div></div></div></div><div><div class="author"><h3 class="author"><span class="firstname">Jelmer</span> <span class="othername">R.</span> <span class="surname">Vernooij</span></h3><div class="affiliation"><span class="orgname">The Samba Team<br></span><div class="address"><p><tt class="email">&lt;<a href="mailto:jelmer@samba.org">jelmer@samba.org</a>&gt;</tt></p></div></div></div></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 class="author"><h3 class="author"><span class="firstname">Karl</span> <span class="surname">Auer</span></h3><div class="affiliation"><span class="orgname">Samba Team<br></span><div class="address"><p><tt class="email">&lt;<a href="mailto:kauer@biplane.com.au">kauer@biplane.com.au</a>&gt;</tt></p></div></div></div></div><div><div class="author"><h3 class="author"><span class="firstname">Dan</span> <span class="surname">Shearer</span></h3><div class="affiliation"><span class="orgname">Samba Team<br></span><div class="address"><p><tt class="email">&lt;<a href="mailto:dan@samba.org">dan@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><a href="install.html#id2876533">Obtaining and Installing Samba</a></dt><dt><a href="install.html#id2876568">Configuring Samba (smb.conf)</a></dt><dd><dl><dt><a href="install.html#id2876606">Configuration file syntax</a></dt><dt><a href="install.html#id2876766">Example Configuration</a></dt><dt><a href="install.html#id2885184">SWAT</a></dt></dl></dd><dt><a href="install.html#id2885250">List Shares Available on the Server</a></dt><dt><a href="install.html#id2885315">Connect with a UNIX Client</a></dt><dt><a href="install.html#id2885433">Connect from a Remote SMB Client</a></dt><dt><a href="install.html#id2885526">What If Things Don't Work?</a></dt><dt><a href="install.html#id2885557">Common Errors</a></dt><dd><dl><dt><a href="install.html#id2885570">Large Number of smbd Processes</a></dt><dt><a href="install.html#id2885679">Error Message: open_oplock_ipc</a></dt><dt><a href="install.html#id2885717">The network name cannot be found</a></dt></dl></dd></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2876533"></a>Obtaining and Installing Samba</h2></div></div><div></div></div><p>
2 Binary packages of Samba are included in almost any Linux or
3 UNIX distribution. There are also some packages available at
4 <ulink url="http://samba.org/">the Samba homepage</ulink>. Refer to
5 the manual of your operating system for details on installing packages
6 for your specific operating system.
7 </p><p>If you need to compile Samba from source, check
8 <link linkend="compiling">.</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2876568"></a>Configuring Samba (smb.conf)</h2></div></div><div></div></div><p>
9 Samba's configuration is stored in the <tt class="filename">smb.conf</tt> file, which
10 usually resides in <tt class="filename">/etc/samba/smb.conf</tt>
11 or <tt class="filename">/usr/local/samba/lib/smb.conf</tt>. You can either
12 edit this file yourself or do it using one of the many graphical
13 tools that are available, such as the Web-based interface SWAT, that
14 is included with Samba.
15 </p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2876606"></a>Configuration file syntax</h3></div></div><div></div></div><p>The <tt class="filename">smb.conf</tt> file uses the same syntax as the various old
16 .ini files in Windows 3.1: Each file consists of various sections,
17 which are started by putting the section name between brackets ([])
18 on a new line. Each contains zero or more key/value-pairs seperated by an
19 equality sign (=). The file is just a plain-text file, so you can
20 open and edit it with your favorite editing tool.</p><p>Each section in the <tt class="filename">smb.conf</tt> file represents a share
21 on the Samba server. The section &#8220;<span class="quote">global</span>&#8221; is special, since it
22 contains settings that apply to the whole Samba server and not
23 to one share in particular.</p><p><link linkend="smbconfminimal"> contains a very minimal <tt class="filename">smb.conf</tt>.
24 <a class="indexterm" name="id2876667"></a>
25 </p><div class="example"><a name="smbconfminimal"></a><p class="title"><b>Example 2.1. A minimal smb.conf</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><i class="parameter"><tt>workgroup = WKG</tt></i></td></tr><tr><td><i class="parameter"><tt>netbios name = MYNAME</tt></i></td></tr><tr><td> </td></tr><tr><td><i class="parameter"><tt>[share1]</tt></i></td></tr><tr><td><i class="parameter"><tt>path = /tmp</tt></i></td></tr><tr><td> </td></tr><tr><td><i class="parameter"><tt>[share2]</tt></i></td></tr><tr><td><i class="parameter"><tt>path = /my_shared_folder</tt></i></td></tr><tr><td><i class="parameter"><tt>comment = Some random files</tt></i></td></tr></table></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2876766"></a>Example Configuration</h3></div></div><div></div></div><p>
26 There are sample configuration files in the examples subdirectory in the
27 distribution. It is suggested you read them carefully so you can see how the options
28 go together in practice. See the man page for all the options.
29 It might be worthwhile to start out with the smb.conf.default
30 configuration file and adapt it to your needs. It contains plenty of
31 comments.
32 </p><p>
33 The simplest useful configuration file would contain something like shown in
34 <link linkend="simple-example">.
35 </p><p>
36 <a class="indexterm" name="id2876804"></a>
37 </p><div class="example"><a name="simple-example"></a><p class="title"><b>Example 2.2. Another simple smb.conf File</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><i class="parameter"><tt>workgroup = MIDEARTH</tt></i></td></tr><tr><td> </td></tr><tr><td><i class="parameter"><tt>[homes]</tt></i></td></tr><tr><td><i class="parameter"><tt>guest ok = no</tt></i></td></tr><tr><td><i class="parameter"><tt>read only = no</tt></i></td></tr></table></div><p>
38 </p><p>
39 This will allow connections by anyone with an account on the server, using either
40 their login name or <i class="parameter"><tt>homes</tt></i> as the service name.
41 (Note: The workgroup that Samba should appear in must also be set. The default
42 workgroup name is WORKGROUP.)
43 </p><p>
44 Make sure you put the <tt class="filename">smb.conf</tt> file in the correct place.
45 </p><p>
46 For more information about security settings for the
47 <i class="parameter"><tt>[homes]</tt></i> share please refer to
48 <link linkend="securing-samba">.
49 </p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2876922"></a>Test Your Config File with <b class="command">testparm</b></h4></div></div><div></div></div><p>
50 It's important to validate the contents of the <tt class="filename">smb.conf</tt> file using the <span class="application">testparm</span> program.
51 If testparm runs correctly, it will list the loaded services. If not, it will give an error message.
52 Make sure it runs correctly and that the services look reasonable before proceeding. Enter the command:
53 </p><pre class="screen">
54 <tt class="prompt">root# </tt> testparm /etc/samba/smb.conf
55 </pre><p>Testparm will parse your configuration file and report
56 any unknown parameters or incorrect syntax. </p><p>
57 Always run testparm again whenever the <tt class="filename">smb.conf</tt> file is changed!
58 </p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2885184"></a>SWAT</h3></div></div><div></div></div><p>
59 <a class="indexterm" name="id2885194"></a>
60 SWAT is a Web-based interface that can be used to facilitate the configuration of Samba.
61 SWAT might not be available in the Samba package that shipped with your platform,
62 but in a separate package. Please read the SWAT manpage
63 on compiling, installing and configuring SWAT from source.
64 </p><p>
65 To launch SWAT, just run your favorite Web browser and point it to
66 <ulink url="http://localhost:901/">http://localhost:901/</ulink>.
67 Replace <i class="replaceable"><tt>localhost</tt></i> with the name of the computer on which
68 Samba is running if that is a different computer than your browser.
69 </p><p>
70 SWAT can be used from a browser on any IP-connected machine, but be aware that connecting from a remote
71 machine leaves your connection open to password sniffing as passwords will be sent over the wire in the clear.
72 </p><p>More information about SWAT can be found in <link linkend="SWAT">.</p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2885250"></a>List Shares Available on the Server</h2></div></div><div></div></div><p>
73 To list shares that are available from the configured Samba server execute the
74 following command:
75 </p><pre class="screen">
76 <tt class="prompt">$ </tt><b class="userinput"><tt>smbclient -L <i class="replaceable"><tt>yourhostname</tt></i></tt></b>
77 </pre><p>You should see a list of shares available on your server. If you do not, then
78 something is incorrectly configured. This method can also be used to see what shares
79 are available on other SMB servers, such as Windows 2000.</p><p>If you choose user-level security you may find that Samba requests a password
80 before it will list the shares. See the <b class="command">smbclient</b> man page for details.
81 You can force it to list the shares without a password by adding the option
82 <tt class="option">-N</tt> to the command line. </p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2885315"></a>Connect with a UNIX Client</h2></div></div><div></div></div><p>
83 Enter the following command:
84 </p><pre class="screen">
85 <tt class="prompt">$ </tt><b class="userinput"><tt>smbclient <i class="replaceable"><tt> //yourhostname/aservice</tt></i></tt></b>
86 </pre><p>Typically <i class="replaceable"><tt>yourhostname</tt></i> is the name of the host on which <span class="application">smbd</span>
87 has been installed. The <i class="replaceable"><tt>aservice</tt></i> is any service that has been defined in the <tt class="filename">smb.conf</tt>
88 file. Try your user name if you just have a <i class="parameter"><tt>[homes]</tt></i> section in the <tt class="filename">smb.conf</tt> file.</p><p>Example: If the UNIX host is called <i class="replaceable"><tt>bambi</tt></i> and a valid login name
89 is <i class="replaceable"><tt>fred</tt></i>, you would type:</p><pre class="screen">
90 <tt class="prompt">$ </tt><b class="userinput"><tt>smbclient //<i class="replaceable"><tt>bambi</tt></i>/<i class="replaceable"><tt>fred</tt></i></tt></b>
91 </pre></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2885433"></a>Connect from a Remote SMB Client</h2></div></div><div></div></div><p>Now that Samba is working correctly locally, you can try to
92 access it from other clients. Within a few minutes, the Samba host
93 should be listed in the Network Neighborhood on all Windows
94 clients of its subnet. Try browsing the server from another client
95 or 'mounting' it.</p><p>Mounting disks from a DOS, Windows or OS/2 client can be done by running a command such as:</p><pre class="screen">
96 <tt class="prompt">C:\&gt; </tt><b class="userinput"><tt>net use d: \\servername\service</tt></b>
97 </pre><p>Try printing, e.g.</p><p>
98 </p><pre class="screen">
99 <tt class="prompt">C:\&gt; </tt><b class="userinput"><tt>net use lpt1: \\servername\spoolservice</tt></b>
100 </pre><p>
101 </p><pre class="screen"><tt class="prompt">C:\&gt; </tt><b class="userinput"><tt>print filename</tt></b>
102 </pre></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2885526"></a>What If Things Don't Work?</h2></div></div><div></div></div><p>You might want to read <link linkend="diagnosis">.
103 If you are still stuck, refer to <link linkend="problems">.
104 Samba has been successfully installed at thousands of sites worldwide.
105 It is unlikely that your particular problem is unique, so it might be
106 productive to perform an Internet search to see if someone else has encountered
107 your problem and has found a way to overcome it.</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2885557"></a>Common Errors</h2></div></div><div></div></div><p>
108 The following questions and issues are raised repeatedly on the Samba mailing list.
109 </p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2885570"></a>Large Number of smbd Processes</h3></div></div><div></div></div><p>
110 Samba consists of three core programs: <span class="application">nmbd</span>, <span class="application">smbd</span>, and <span class="application">winbindd</span>. <span class="application">nmbd</span> is the name server message daemon,
111 <span class="application">smbd</span> is the server message daemon, and <span class="application">winbindd</span> is the daemon that handles communication with Domain Controllers.
112 </p><p>
113 If Samba is <span class="emphasis"><em>not</em></span> running as a WINS server, then there will be one single instance of
114 <span class="application">nmbd</span> running on your system. If it is running as a WINS server then there will be
115 two instances one to handle the WINS requests.
116 </p><p>
117 <span class="application">smbd</span> handles all connection requests. It spawns a new process for each client
118 connection made. That is why you may see so many of them, one per client connection.
119 </p><p>
120 <span class="application">winbindd</span> will run as one or two daemons, depending on whether or not it is being
121 run in <span class="emphasis"><em>split mode</em></span> (in which case there will be two instances).
122 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2885679"></a>Error Message: open_oplock_ipc</h3></div></div><div></div></div><p>An error message is observed in the log files when <span class="application">smbd</span> is started: &#8220;<span class="quote">open_oplock_ipc: Failed to get local UDP socket
123 for address 100007f. Error was Cannot assign requested.</span>&#8221;</p><p>Your loopback device isn't working correctly. Make sure it is configured correctly. The loopback
124 device is an internal (virtual) network device with the IP address <span class="emphasis"><em>127.0.0.1</em></span>.
125 Read your OS documentation for details on how to configure the loopback on your system.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2885717"></a>&#8220;<span class="quote"><span class="errorname">The network name cannot be found</span></span>&#8221;</h3></div></div><div></div></div><p>
126 This error can be caused by one of these misconfigurations:
127 </p><div class="itemizedlist"><ul type="disc"><li><p>You specified an nonexisting path
128 for the share in <tt class="filename">smb.conf</tt>.</p></li><li><p>The user you are trying to access the share with does not
129 have sufficient permissions to access the path for
130 the share. Both read (r) and access (x) should be possible.</p></li><li><p>The share you are trying to access does not exist.</p></li></ul></div></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="IntroSMB.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="FastStart.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 1. Introduction to Samba </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 3. Fast Start for the Impatient</td></tr></table></div></body></html>