- Add &author.mimir; entity
[Samba/gebeck_regimport.git] / docs / docbook / projdoc / UNIX_INSTALL.sgml
blob6deb0c915e4c5d2b8f8f7d9f68c39acf8d83f61b
1 <chapter id="install">
2 <chapterinfo>
3 &author.tridge;
4 &author.jelmer;
5 <author><firstname>Karl</firstname><surname>Auer</surname></author>
6 <!-- Isn't some of this written by others as well? -->
8 </chapterinfo>
10 <title>How to Install and Test SAMBA</title>
12 <sect1>
13 <title>Obtaining and installing samba</title>
15 <para>Binary packages of samba are included in almost any Linux or
16 Unix distribution. There are also some packages available at
17 <ulink url="http://samba.org/">the samba homepage</ulink>.
18 </para>
20 <para>If you need to compile samba from source, check the
21 <link linkend="compiling">appropriate appendix chapter</link>.</para>
22 </sect1>
24 <sect1>
25 <title>Configuring samba</title>
27 <para>Samba's configuration is stored in the smb.conf file,
28 that usually resides in <filename>/etc/samba/smb.conf</filename>
29 or <filename>/usr/local/samba/lib/smb.conf</filename>. You can either
30 edit this file yourself or do it using one of the many graphical
31 tools that are available, such as the web-based interface swat, that
32 is included with samba.</para>
34 <sect2>
35 <title>Editing the <filename>smb.conf</filename> file</title>
37 <para>There are sample configuration files in the examples
38 subdirectory in the distribution. I suggest you read them
39 carefully so you can see how the options go together in
40 practice. See the man page for all the options.</para>
42 <para>The simplest useful configuration file would be
43 something like this:</para>
45 <para><programlisting>
46 [global]
47 workgroup = MYGROUP
49 [homes]
50 guest ok = no
51 read only = no
52 </programlisting></para>
54 <para>which would allow connections by anyone with an
55 account on the server, using either their login name or
56 "<command>homes</command>" as the service name. (Note that I also set the
57 workgroup that Samba is part of. See BROWSING.txt for details)</para>
59 <para>Make sure you put the <filename>smb.conf</filename> file in the same place
60 you specified in the<filename>Makefile</filename> (the default is to
61 look for it in <filename>/usr/local/samba/lib/</filename>).</para>
63 <para>For more information about security settings for the
64 <command>[homes]</command> share please refer to the chapter
65 <link linkend="securing-samba">Securing Samba</link>.</para>
67 <sect3>
68 <title>Test your config file with
69 <command>testparm</command></title>
71 <para>It's important that you test the validity of your
72 <filename>smb.conf</filename> file using the <application>testparm</application> program.
73 If testparm runs OK then it will list the loaded services. If
74 not it will give an error message.</para>
76 <para>Make sure it runs OK and that the services look
77 reasonable before proceeding. </para>
79 <para>Always run testparm again when you change
80 <filename>smb.conf</filename>!</para>
82 </sect3>
83 </sect2>
85 <sect2>
86 <title>SWAT</title>
88 <para>
89 SWAT is a web-based interface that helps you configure samba.
90 SWAT might not be available in the samba package on your platform,
91 but in a seperate package. Please read the swat manpage
92 on compiling, installing and configuring swat from source.
93 </para>
95 <para>To launch SWAT just run your favorite web browser and
96 point it at "http://localhost:901/". Replace <replaceable>localhost</replaceable> with the name of the computer you are running samba on if you
97 are running samba on a different computer then your browser.</para>
99 <para>Note that you can attach to SWAT from any IP connected
100 machine but connecting from a remote machine leaves your
101 connection open to password sniffing as passwords will be sent
102 in the clear over the wire. </para>
103 </sect2>
104 </sect1>
106 <sect1>
107 <title>Try listing the shares available on your
108 server</title>
110 <para><prompt>$ </prompt><userinput>smbclient -L
111 <replaceable>yourhostname</replaceable></userinput></para>
113 <para>You should get back a list of shares available on
114 your server. If you don't then something is incorrectly setup.
115 Note that this method can also be used to see what shares
116 are available on other LanManager clients (such as WfWg).</para>
118 <para>If you choose user level security then you may find
119 that Samba requests a password before it will list the shares.
120 See the <command>smbclient</command> man page for details. (you
121 can force it to list the shares without a password by
122 adding the option -U% to the command line. This will not work
123 with non-Samba servers)</para>
124 </sect1>
126 <sect1>
127 <title>Try connecting with the unix client</title>
129 <para><prompt>$ </prompt><userinput>smbclient <replaceable>
130 //yourhostname/aservice</replaceable></userinput></para>
132 <para>Typically the <replaceable>yourhostname</replaceable>
133 would be the name of the host where you installed &smbd;.
134 The <replaceable>aservice</replaceable> is
135 any service you have defined in the &smb.conf;
136 file. Try your user name if you just have a <command>[homes]</command>
137 section
138 in &smb.conf;.</para>
140 <para>For example if your unix host is <replaceable>bambi</replaceable>
141 and your login name is <replaceable>fred</replaceable> you would type:</para>
143 <para><prompt>$ </prompt><userinput>smbclient //<replaceable>bambi</replaceable>/<replaceable>fred</replaceable>
144 </userinput></para>
145 </sect1>
147 <sect1>
148 <title>Try connecting from a DOS, WfWg, Win9x, WinNT,
149 Win2k, OS/2, etc... client</title>
151 <para>Try mounting disks. eg:</para>
153 <para><prompt>C:\WINDOWS\> </prompt><userinput>net use d: \\servername\service
154 </userinput></para>
156 <para>Try printing. eg:</para>
158 <para><prompt>C:\WINDOWS\> </prompt><userinput>net use lpt1:
159 \\servername\spoolservice</userinput></para>
161 <para><prompt>C:\WINDOWS\> </prompt><userinput>print filename
162 </userinput></para>
163 </sect1>
165 <sect1>
166 <title>What If Things Don't Work?</title>
168 <para>Then you might read the file chapter
169 <link linkend="diagnosis">Diagnosis</link> and the
170 FAQ. If you are still stuck then try the mailing list or
171 newsgroup (look in the README for details). Samba has been
172 successfully installed at thousands of sites worldwide, so maybe
173 someone else has hit your problem and has overcome it. You could
174 also use the WWW site to scan back issues of the samba-digest.</para>
176 <para>When you fix the problem <emphasis>please</emphasis> send some
177 updates of the documentation (or source code) to one of
178 the documentation maintainers or the list.
179 </para>
181 <sect2>
182 <title>Scope IDs</title>
184 <para>By default Samba uses a blank scope ID. This means
185 all your windows boxes must also have a blank scope ID.
186 If you really want to use a non-blank scope ID then you will
187 need to use the 'netbios scope' smb.conf option.
188 All your PCs will need to have the same setting for
189 this to work. I do not recommend scope IDs.</para>
190 </sect2>
192 <sect2>
193 <title>Locking</title>
195 <para>One area which sometimes causes trouble is locking.</para>
197 <para>There are two types of locking which need to be
198 performed by a SMB server. The first is "record locking"
199 which allows a client to lock a range of bytes in a open file.
200 The second is the "deny modes" that are specified when a file
201 is open.</para>
203 <para>Record locking semantics under Unix is very
204 different from record locking under Windows. Versions
205 of Samba before 2.2 have tried to use the native
206 fcntl() unix system call to implement proper record
207 locking between different Samba clients. This can not
208 be fully correct due to several reasons. The simplest
209 is the fact that a Windows client is allowed to lock a
210 byte range up to 2^32 or 2^64, depending on the client
211 OS. The unix locking only supports byte ranges up to
212 2^31. So it is not possible to correctly satisfy a
213 lock request above 2^31. There are many more
214 differences, too many to be listed here.</para>
216 <para>Samba 2.2 and above implements record locking
217 completely independent of the underlying unix
218 system. If a byte range lock that the client requests
219 happens to fall into the range 0-2^31, Samba hands
220 this request down to the Unix system. All other locks
221 can not be seen by unix anyway.</para>
223 <para>Strictly a SMB server should check for locks before
224 every read and write call on a file. Unfortunately with the
225 way fcntl() works this can be slow and may overstress the
226 rpc.lockd. It is also almost always unnecessary as clients
227 are supposed to independently make locking calls before reads
228 and writes anyway if locking is important to them. By default
229 Samba only makes locking calls when explicitly asked
230 to by a client, but if you set "strict locking = yes" then it will
231 make lock checking calls on every read and write. </para>
233 <para>You can also disable by range locking completely
234 using "locking = no". This is useful for those shares that
235 don't support locking or don't need it (such as cdroms). In
236 this case Samba fakes the return codes of locking calls to
237 tell clients that everything is OK.</para>
239 <para>The second class of locking is the "deny modes". These
240 are set by an application when it opens a file to determine
241 what types of access should be allowed simultaneously with
242 its open. A client may ask for DENY_NONE, DENY_READ, DENY_WRITE
243 or DENY_ALL. There are also special compatibility modes called
244 DENY_FCB and DENY_DOS.</para>
246 <!-- FIXME: Sync this with oplocks.sgml -->
247 </sect2>
248 </sect1>
249 </chapter>