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