1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
5 >How to Install and Test SAMBA</TITLE
8 CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
10 TITLE="SAMBA Project Documentation"
11 HREF="samba-howto-collection.html"><LINK
13 TITLE="General installation"
14 HREF="introduction.html"><LINK
16 TITLE="General installation"
17 HREF="introduction.html"><LINK
19 TITLE="Quick Cross Subnet Browsing / Cross Workgroup Browsing guide"
20 HREF="browsing-quick.html"></HEAD
31 SUMMARY="Header navigation table"
40 >SAMBA Project Documentation</TH
48 HREF="introduction.html"
62 HREF="browsing-quick.html"
77 >Chapter 1. How to Install and Test SAMBA</H1
84 >1.1. Obtaining and installing samba</A
87 >Binary packages of samba are included in almost any Linux or
88 Unix distribution. There are also some packages available at
90 HREF="http://samba.org/"
92 >the samba homepage</A
96 >If you need to compile samba from source, check the
99 >appropriate appendix chapter</A
108 >1.2. Configuring samba</A
111 >Samba's configuration is stored in the smb.conf file,
112 that usually resides in <TT
114 >/etc/samba/smb.conf</TT
118 >/usr/local/samba/lib/smb.conf</TT
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
129 >1.2.1. Editing the <TT
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
140 >The simplest useful configuration file would be
141 something like this:</P
144 CLASS="PROGRAMLISTING"
154 >which would allow connections by anyone with an
155 account on the server, using either their login name or
159 >" as the service name. (Note that I also set the
160 workgroup that Samba is part of. See BROWSING.txt for details)</P
162 >Make sure you put the <TT
165 > file in the same place
166 you specified in the<TT
172 >/usr/local/samba/lib/</TT
175 >For more information about security settings for the
179 > share please refer to the chapter
181 HREF="securing-samba.html"
190 >1.2.1.1. Test your config file with
197 >It's important that you test the validity of your
201 > file using the <SPAN
205 If testparm runs OK then it will list the loaded services. If
206 not it will give an error message.</P
208 >Make sure it runs OK and that the services look
209 reasonable before proceeding. </P
211 >Always run testparm again when you change
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.
233 >To launch SWAT just run your favorite web browser and
234 point it at "http://localhost:901/". Replace <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
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
252 >1.3. Try listing the shares available on your
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
273 >If you choose user level security then you may find
274 that Samba requests a password before it will list the shares.
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
289 >1.4. Try connecting with the unix client</A
299 > //yourhostname/aservice</VAR
307 would be the name of the host where you installed <SPAN
315 any service you have defined in the <TT
319 file. Try your user name if you just have a <B
329 >For example if your unix host is <VAR
333 and your login name is <VAR
359 >1.5. Try connecting from a DOS, WfWg, Win9x, WinNT,
360 Win2k, OS/2, etc... client</A
363 >Try mounting disks. eg:</P
367 >C:\WINDOWS\> </SAMP
370 >net use d: \\servername\service
374 >Try printing. eg:</P
378 >C:\WINDOWS\> </SAMP
382 \\servername\spoolservice</KBD
387 >C:\WINDOWS\> </SAMP
400 >1.6. What If Things Don't Work?</A
403 >Then you might read the file chapter
405 HREF="diagnosis.html"
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
414 >When you fix the problem <SPAN
421 updates of the documentation (or source code) to one of
422 the documentation maintainers or the list.
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
449 >One area which sometimes causes trouble is locking.</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
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
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
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
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
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
507 SUMMARY="Footer navigation table"
518 HREF="introduction.html"
527 HREF="samba-howto-collection.html"
536 HREF="browsing-quick.html"
546 >General installation</TD
552 HREF="introduction.html"
560 >Quick Cross Subnet Browsing / Cross Workgroup Browsing guide</TD