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
97 appropriate appendix chapter.</P
105 >1.2. Configuring samba</A
108 >Samba's configuration is stored in the smb.conf file,
109 that usually resides in <TT
111 >/etc/samba/smb.conf</TT
115 >/usr/local/samba/lib/smb.conf</TT
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
126 >1.2.1. Editing the smb.conf file</A
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
134 >The simplest useful configuration file would be
135 something like this:</P
138 CLASS="PROGRAMLISTING"
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
160 > file. You need to create it
163 >Make sure you put the smb.conf file in the same place
164 you specified in the<TT
170 >/usr/local/samba/lib/</TT
173 >For more information about security settings for the
174 [homes] share please refer to the document UNIX_SECURITY.txt.</P
181 >1.2.1.1. Test your config file with
188 >It's important that you test the validity of your
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
196 >Make sure it runs OK and that the services look
197 reasonable before proceeding. </P
199 >Always run testparm again when you change
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.
221 >To launch SWAT just run your favorite web browser and
222 point it at "http://localhost:901/". Replace <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
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
240 >1.3. Try listing the shares available on your
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
261 >If you choose user level security then you may find
262 that Samba requests a password before it will list the shares.
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
277 >1.4. Try connecting with the unix client</A
287 > //yourhostname/aservice</VAR
295 would be the name of the host where you installed <B
302 any service you have defined in the <TT
306 file. Try your user name if you just have a [homes] section
312 >For example if your unix host is bambi and your login
313 name is fred you would type:</P
320 >smbclient //bambi/fred
330 >1.5. Try connecting from a DOS, WfWg, Win9x, WinNT,
331 Win2k, OS/2, etc... client</A
334 >Try mounting disks. eg:</P
338 >C:\WINDOWS\> </SAMP
341 >net use d: \\servername\service
345 >Try printing. eg:</P
349 >C:\WINDOWS\> </SAMP
353 \\servername\spoolservice</KBD
358 >C:\WINDOWS\> </SAMP
365 >Celebrate, or send me a bug report!</P
373 >1.6. What If Things Don't Work?</A
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
383 >When you fix the problem <SPAN
390 updates of the documentation (or source code) to one of
391 the documentation maintainers or the list.
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
418 >One area which sometimes causes trouble is locking.</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
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
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
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
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
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
476 SUMMARY="Footer navigation table"
487 HREF="introduction.html"
496 HREF="samba-howto-collection.html"
505 HREF="browsing-quick.html"
515 >General installation</TD
521 HREF="introduction.html"
529 >Quick Cross Subnet Browsing / Cross Workgroup Browsing guide</TD