Regenerate docs
[abartlet/samba.git/.git] / docs / htmldocs / install.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <HTML
3 ><HEAD
4 ><TITLE
5 >How to Install and Test SAMBA</TITLE
6 ><META
7 NAME="GENERATOR"
8 CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
9 REL="HOME"
10 TITLE="SAMBA Project Documentation"
11 HREF="samba-howto-collection.html"><LINK
12 REL="UP"
13 TITLE="General installation"
14 HREF="introduction.html"><LINK
15 REL="PREVIOUS"
16 TITLE="General installation"
17 HREF="introduction.html"><LINK
18 REL="NEXT"
19 TITLE="Quick Cross Subnet Browsing / Cross Workgroup Browsing guide"
20 HREF="browsing-quick.html"></HEAD
21 ><BODY
22 CLASS="CHAPTER"
23 BGCOLOR="#FFFFFF"
24 TEXT="#000000"
25 LINK="#0000FF"
26 VLINK="#840084"
27 ALINK="#0000FF"
28 ><DIV
29 CLASS="NAVHEADER"
30 ><TABLE
31 SUMMARY="Header navigation table"
32 WIDTH="100%"
33 BORDER="0"
34 CELLPADDING="0"
35 CELLSPACING="0"
36 ><TR
37 ><TH
38 COLSPAN="3"
39 ALIGN="center"
40 >SAMBA Project Documentation</TH
41 ></TR
42 ><TR
43 ><TD
44 WIDTH="10%"
45 ALIGN="left"
46 VALIGN="bottom"
47 ><A
48 HREF="introduction.html"
49 ACCESSKEY="P"
50 >Prev</A
51 ></TD
52 ><TD
53 WIDTH="80%"
54 ALIGN="center"
55 VALIGN="bottom"
56 ></TD
57 ><TD
58 WIDTH="10%"
59 ALIGN="right"
60 VALIGN="bottom"
61 ><A
62 HREF="browsing-quick.html"
63 ACCESSKEY="N"
64 >Next</A
65 ></TD
66 ></TR
67 ></TABLE
68 ><HR
69 ALIGN="LEFT"
70 WIDTH="100%"></DIV
71 ><DIV
72 CLASS="CHAPTER"
73 ><H1
74 ><A
75 NAME="INSTALL"
76 ></A
77 >Chapter 1. How to Install and Test SAMBA</H1
78 ><DIV
79 CLASS="SECT1"
80 ><H1
81 CLASS="SECT1"
82 ><A
83 NAME="AEN65"
84 >1.1. Obtaining and installing samba</A
85 ></H1
86 ><P
87 >Binary packages of samba are included in almost any Linux or 
88         Unix distribution. There are also some packages available at 
89         <A
90 HREF="http://samba.org/"
91 TARGET="_top"
92 >the samba homepage</A
93 >
94         </P
95 ><P
96 >If you need to compile samba from source, check the 
97         appropriate appendix chapter.</P
98 ></DIV
99 ><DIV
100 CLASS="SECT1"
101 ><H1
102 CLASS="SECT1"
103 ><A
104 NAME="AEN70"
105 >1.2. Configuring samba</A
106 ></H1
107 ><P
108 >Samba's configuration is stored in the smb.conf file, 
109         that usually resides in <TT
110 CLASS="FILENAME"
111 >/etc/samba/smb.conf</TT
112
113         or <TT
114 CLASS="FILENAME"
115 >/usr/local/samba/lib/smb.conf</TT
116 >. You can either 
117         edit this file yourself or do it using one of the many graphical 
118         tools that are available, such as the web-based interface swat, that 
119         is included with samba.</P
120 ><DIV
121 CLASS="SECT2"
122 ><H2
123 CLASS="SECT2"
124 ><A
125 NAME="AEN75"
126 >1.2.1. Editing the smb.conf file</A
127 ></H2
128 ><P
129 >There are sample configuration files in the examples 
130         subdirectory in the distribution. I suggest you read them 
131         carefully so you can see how the options go together in 
132         practice. See the man page for all the options.</P
133 ><P
134 >The simplest useful configuration file would be 
135         something like this:</P
136 ><P
137 ><PRE
138 CLASS="PROGRAMLISTING"
139 >       [global]
140            workgroup = MYGROUP
141
142            [homes]
143               guest ok = no
144               read only = no
145         </PRE
146 ></P
147 ><P
148 >which would allow connections by anyone with an 
149         account on the server, using either their login name or 
150         "homes" as the service name. (Note that I also set the 
151         workgroup that Samba is part of. See BROWSING.txt for details)</P
152 ><P
153 >Note that <B
154 CLASS="COMMAND"
155 >make install</B
156 > will not install 
157         a <TT
158 CLASS="FILENAME"
159 >smb.conf</TT
160 > file. You need to create it 
161         yourself. </P
162 ><P
163 >Make sure you put the smb.conf file in the same place 
164         you specified in the<TT
165 CLASS="FILENAME"
166 >Makefile</TT
167 > (the default is to 
168         look for it in <TT
169 CLASS="FILENAME"
170 >/usr/local/samba/lib/</TT
171 >).</P
172 ><P
173 >For more information about security settings for the 
174         [homes] share please refer to the document UNIX_SECURITY.txt.</P
175 ><DIV
176 CLASS="SECT3"
177 ><H3
178 CLASS="SECT3"
179 ><A
180 NAME="AEN89"
181 >1.2.1.1. Test your config file with 
182         <B
183 CLASS="COMMAND"
184 >testparm</B
185 ></A
186 ></H3
187 ><P
188 >It's important that you test the validity of your
189         <TT
190 CLASS="FILENAME"
191 >smb.conf</TT
192 > file using the testparm program. 
193         If testparm runs OK then it will list the loaded services. If 
194         not it will give an error message.</P
195 ><P
196 >Make sure it runs OK and that the services look 
197         reasonable before proceeding. </P
198 ><P
199 >Always run testparm again when you change 
200         <TT
201 CLASS="FILENAME"
202 >smb.conf</TT
203 >!</P
204 ></DIV
205 ></DIV
206 ><DIV
207 CLASS="SECT2"
208 ><H2
209 CLASS="SECT2"
210 ><A
211 NAME="AEN97"
212 >1.2.2. SWAT</A
213 ></H2
214 ><P
215 >       SWAT is a web-based interface that helps you configure samba. 
216         SWAT might not be available in the samba package on your platform, 
217         but in a seperate package. Please read the swat manpage 
218         on compiling, installing and configuring swat from source.
219         </P
220 ><P
221 >To launch SWAT just run your favorite web browser and 
222         point it at "http://localhost:901/". Replace <VAR
223 CLASS="REPLACEABLE"
224 >localhost</VAR
225 > with the name of the computer you are running samba on if you 
226         are running samba on a different computer then your browser.</P
227 ><P
228 >Note that you can attach to SWAT from any IP connected 
229         machine but connecting from a remote machine leaves your 
230         connection open to password sniffing as passwords will be sent 
231         in the clear over the wire. </P
232 ></DIV
233 ></DIV
234 ><DIV
235 CLASS="SECT1"
236 ><H1
237 CLASS="SECT1"
238 ><A
239 NAME="AEN103"
240 >1.3. Try listing the shares available on your 
241         server</A
242 ></H1
243 ><P
244 ><SAMP
245 CLASS="PROMPT"
246 >$ </SAMP
247 ><KBD
248 CLASS="USERINPUT"
249 >smbclient -L 
250         <VAR
251 CLASS="REPLACEABLE"
252 >yourhostname</VAR
253 ></KBD
254 ></P
255 ><P
256 >You should get back a list of shares available on 
257         your server. If you don't then something is incorrectly setup. 
258         Note that this method can also be used to see what shares 
259         are available on other LanManager clients (such as WfWg).</P
260 ><P
261 >If you choose user level security then you may find 
262         that Samba requests a password before it will list the shares. 
263         See the <B
264 CLASS="COMMAND"
265 >smbclient</B
266 > man page for details. (you 
267         can force it to list the shares without a password by
268         adding the option -U% to the command line. This will not work 
269         with non-Samba servers)</P
270 ></DIV
271 ><DIV
272 CLASS="SECT1"
273 ><H1
274 CLASS="SECT1"
275 ><A
276 NAME="AEN112"
277 >1.4. Try connecting with the unix client</A
278 ></H1
279 ><P
280 ><SAMP
281 CLASS="PROMPT"
282 >$ </SAMP
283 ><KBD
284 CLASS="USERINPUT"
285 >smbclient <VAR
286 CLASS="REPLACEABLE"
287 >       //yourhostname/aservice</VAR
288 ></KBD
289 ></P
290 ><P
291 >Typically the <VAR
292 CLASS="REPLACEABLE"
293 >yourhostname</VAR
294
295         would be the name of the host where you installed <B
296 CLASS="COMMAND"
297 >       smbd</B
298 >. The <VAR
299 CLASS="REPLACEABLE"
300 >aservice</VAR
301 > is 
302         any service you have defined in the <TT
303 CLASS="FILENAME"
304 >smb.conf</TT
305
306         file. Try your user name if you just have a [homes] section
307         in <TT
308 CLASS="FILENAME"
309 >smb.conf</TT
310 >.</P
311 ><P
312 >For example if your unix host is bambi and your login 
313         name is fred you would type:</P
314 ><P
315 ><SAMP
316 CLASS="PROMPT"
317 >$ </SAMP
318 ><KBD
319 CLASS="USERINPUT"
320 >smbclient //bambi/fred
321         </KBD
322 ></P
323 ></DIV
324 ><DIV
325 CLASS="SECT1"
326 ><H1
327 CLASS="SECT1"
328 ><A
329 NAME="AEN128"
330 >1.5. Try connecting from a DOS, WfWg, Win9x, WinNT, 
331         Win2k, OS/2, etc... client</A
332 ></H1
333 ><P
334 >Try mounting disks. eg:</P
335 ><P
336 ><SAMP
337 CLASS="PROMPT"
338 >C:\WINDOWS\&#62; </SAMP
339 ><KBD
340 CLASS="USERINPUT"
341 >net use d: \\servername\service
342         </KBD
343 ></P
344 ><P
345 >Try printing. eg:</P
346 ><P
347 ><SAMP
348 CLASS="PROMPT"
349 >C:\WINDOWS\&#62; </SAMP
350 ><KBD
351 CLASS="USERINPUT"
352 >net use lpt1:
353         \\servername\spoolservice</KBD
354 ></P
355 ><P
356 ><SAMP
357 CLASS="PROMPT"
358 >C:\WINDOWS\&#62; </SAMP
359 ><KBD
360 CLASS="USERINPUT"
361 >print filename
362         </KBD
363 ></P
364 ><P
365 >Celebrate, or send me a bug report!</P
366 ></DIV
367 ><DIV
368 CLASS="SECT1"
369 ><H1
370 CLASS="SECT1"
371 ><A
372 NAME="AEN142"
373 >1.6. What If Things Don't Work?</A
374 ></H1
375 ><P
376 >Then you might read the file HOWTO chapter Diagnosis and the 
377         FAQ. If you are still stuck then try the mailing list or 
378         newsgroup (look in the README for details). Samba has been 
379         successfully installed at thousands of sites worldwide, so maybe 
380         someone else has hit your problem and has overcome it. You could 
381         also use the WWW site to scan back issues of the samba-digest.</P
382 ><P
383 >When you fix the problem <SPAN
384 CLASS="emphasis"
385 ><I
386 CLASS="EMPHASIS"
387 >please</I
388 ></SPAN
389 > send some 
390         updates of the documentation (or source code) to one of 
391         the documentation maintainers or the list.
392         </P
393 ><DIV
394 CLASS="SECT2"
395 ><H2
396 CLASS="SECT2"
397 ><A
398 NAME="AEN147"
399 >1.6.1. Scope IDs</A
400 ></H2
401 ><P
402 >By default Samba uses a blank scope ID. This means 
403                 all your windows boxes must also have a blank scope ID. 
404                 If you really want to use a non-blank scope ID then you will 
405                 need to use the 'netbios scope' smb.conf option.
406         All your PCs will need to have the same setting for 
407                 this to work. I do not recommend scope IDs.</P
408 ></DIV
409 ><DIV
410 CLASS="SECT2"
411 ><H2
412 CLASS="SECT2"
413 ><A
414 NAME="AEN150"
415 >1.6.2. Locking</A
416 ></H2
417 ><P
418 >One area which sometimes causes trouble is locking.</P
419 ><P
420 >There are two types of locking which need to be 
421                 performed by a SMB server. The first is "record locking" 
422                 which allows a client to lock a range of bytes in a open file. 
423                 The second is the "deny modes" that are specified when a file 
424                 is open.</P
425 ><P
426 >Record locking semantics under Unix is very
427                 different from record locking under Windows. Versions
428                 of Samba before 2.2 have tried to use the native
429                 fcntl() unix system call to implement proper record
430                 locking between different Samba clients. This can not
431                 be fully correct due to several reasons. The simplest
432                 is the fact that a Windows client is allowed to lock a
433                 byte range up to 2^32 or 2^64, depending on the client
434                 OS. The unix locking only supports byte ranges up to
435                 2^31. So it is not possible to correctly satisfy a
436                 lock request above 2^31. There are many more
437                 differences, too many to be listed here.</P
438 ><P
439 >Samba 2.2 and above implements record locking
440                 completely independent of the underlying unix
441                 system. If a byte range lock that the client requests
442                 happens to fall into the range 0-2^31, Samba hands
443                 this request down to the Unix system. All other locks
444                 can not be seen by unix anyway.</P
445 ><P
446 >Strictly a SMB server should check for locks before 
447                 every read and write call on a file. Unfortunately with the 
448                 way fcntl() works this can be slow and may overstress the 
449                 rpc.lockd. It is also almost always unnecessary as clients 
450                 are supposed to independently make locking calls before reads 
451                 and writes anyway if locking is important to them. By default 
452                 Samba only makes locking calls when explicitly asked
453                 to by a client, but if you set "strict locking = yes" then it will
454                 make lock checking calls on every read and write. </P
455 ><P
456 >You can also disable by range locking completely 
457                 using "locking = no". This is useful for those shares that 
458                 don't support locking or don't need it (such as cdroms). In 
459                 this case Samba fakes the return codes of locking calls to 
460                 tell clients that everything is OK.</P
461 ><P
462 >The second class of locking is the "deny modes". These 
463                 are set by an application when it opens a file to determine 
464                 what types of access should be allowed simultaneously with 
465                 its open. A client may ask for DENY_NONE, DENY_READ, DENY_WRITE 
466                 or DENY_ALL. There are also special compatibility modes called 
467                 DENY_FCB and  DENY_DOS.</P
468 ></DIV
469 ></DIV
470 ></DIV
471 ><DIV
472 CLASS="NAVFOOTER"
473 ><HR
474 ALIGN="LEFT"
475 WIDTH="100%"><TABLE
476 SUMMARY="Footer navigation table"
477 WIDTH="100%"
478 BORDER="0"
479 CELLPADDING="0"
480 CELLSPACING="0"
481 ><TR
482 ><TD
483 WIDTH="33%"
484 ALIGN="left"
485 VALIGN="top"
486 ><A
487 HREF="introduction.html"
488 ACCESSKEY="P"
489 >Prev</A
490 ></TD
491 ><TD
492 WIDTH="34%"
493 ALIGN="center"
494 VALIGN="top"
495 ><A
496 HREF="samba-howto-collection.html"
497 ACCESSKEY="H"
498 >Home</A
499 ></TD
500 ><TD
501 WIDTH="33%"
502 ALIGN="right"
503 VALIGN="top"
504 ><A
505 HREF="browsing-quick.html"
506 ACCESSKEY="N"
507 >Next</A
508 ></TD
509 ></TR
510 ><TR
511 ><TD
512 WIDTH="33%"
513 ALIGN="left"
514 VALIGN="top"
515 >General installation</TD
516 ><TD
517 WIDTH="34%"
518 ALIGN="center"
519 VALIGN="top"
520 ><A
521 HREF="introduction.html"
522 ACCESSKEY="U"
523 >Up</A
524 ></TD
525 ><TD
526 WIDTH="33%"
527 ALIGN="right"
528 VALIGN="top"
529 >Quick Cross Subnet Browsing / Cross Workgroup Browsing guide</TD
530 ></TR
531 ></TABLE
532 ></DIV
533 ></BODY
534 ></HTML
535 >