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.76b+
11 TITLE="SAMBA Project Documentation"
12 HREF="samba-howto-collection.html"><LINK
14 TITLE="General installation"
15 HREF="introduction.html"><LINK
17 TITLE="General installation"
18 HREF="introduction.html"><LINK
20 TITLE="Improved browsing in samba"
21 HREF="improved-browsing.html"></HEAD
32 SUMMARY="Header navigation table"
41 >SAMBA Project Documentation</TH
49 HREF="introduction.html"
63 HREF="improved-browsing.html"
76 NAME="INSTALL">Chapter 1. How to Install and Test SAMBA</H1
82 NAME="AEN26">1.1. Read the man pages</H1
84 >The man pages distributed with SAMBA contain
85 lots of useful info that will help to get you started.
86 If you don't know how to read man pages then try
105 >nroff -man smbd.8 | more
108 > on older unixes.</P
110 >Other sources of information are pointed to
111 by the Samba web site,<A
112 HREF="http://www.samba.org/"
114 > http://www.samba.org</A
122 NAME="AEN36">1.2. Building the Binaries</H1
124 >To do this, first run the program <B
128 > in the source directory. This should automatically
129 configure Samba for your operating system. If you have unusual
130 needs then you may wish to run</P
143 >first to see what special options you can enable.
156 >will create the binaries. Once it's successfully
157 compiled you can use </P
169 >to install the binaries and manual pages. You can
170 separately install the binaries and/or man pages using</P
196 >Note that if you are upgrading for a previous version
197 of Samba you might like to know that the old versions of
198 the binaries will be renamed with a ".old" extension. You
199 can go back to the previous version with</P
212 >if you find this version a disaster!</P
219 NAME="AEN64">1.3. The all important step</H1
221 >At this stage you must fetch yourself a
222 coffee or other drink you find stimulating. Getting the rest
223 of the install right can sometimes be tricky, so you will
226 >If you have installed samba before then you can skip
234 NAME="AEN68">1.4. Create the smb configuration file.</H1
236 >There are sample configuration files in the examples
237 subdirectory in the distribution. I suggest you read them
238 carefully so you can see how the options go together in
239 practice. See the man page for all the options.</P
241 >The simplest useful configuration file would be
242 something like this:</P
245 CLASS="PROGRAMLISTING"
255 >which would allow connections by anyone with an
256 account on the server, using either their login name or
257 "homes" as the service name. (Note that I also set the
258 workgroup that Samba is part of. See BROWSING.txt for details)</P
267 > file. You need to create it
270 >Make sure you put the smb.conf file in the same place
271 you specified in the<TT
277 >/usr/local/samba/lib/</TT
280 >For more information about security settings for the
281 [homes] share please refer to the document UNIX_SECURITY.txt.</P
288 NAME="AEN82">1.5. Test your config file with
294 >It's important that you test the validity of your
298 > file using the testparm program.
299 If testparm runs OK then it will list the loaded services. If
300 not it will give an error message.</P
302 >Make sure it runs OK and that the services look
303 reasonable before proceeding. </P
305 >Always run testparm again when you change
316 NAME="AEN90">1.6. Starting the smbd and nmbd</H1
318 >You must choose to start smbd and nmbd either
319 as daemons or from <B
323 to do both! Either you can put them in <TT
326 > and have them started on demand
330 >, or you can start them as
331 daemons either from the command line or in <TT
334 >. See the man pages for details
335 on the command line options. Take particular care to read
336 the bit about what user you need to be in order to start
337 Samba. In many cases you must be root.</P
339 >The main advantage of starting <B
346 > using the recommended daemon method
347 is that they will respond slightly more quickly to an initial connection
354 NAME="AEN100">1.6.1. Starting from inetd.conf</H2
356 >NOTE; The following will be different if
357 you use NIS or NIS+ to distributed services maps.</P
363 What is defined at port 139/tcp. If nothing is defined
364 then add a line like this:</P
369 >netbios-ssn 139/tcp</B
373 >similarly for 137/udp you should have an entry like:</P
378 >netbios-ns 137/udp</B
386 and add two lines something like this:</P
389 CLASS="PROGRAMLISTING"
390 > netbios-ssn stream tcp nowait root /usr/local/samba/bin/smbd smbd
391 netbios-ns dgram udp wait root /usr/local/samba/bin/nmbd nmbd
395 >The exact syntax of <TT
399 varies between unixes. Look at the other entries in inetd.conf
402 >NOTE: Some unixes already have entries like netbios_ns
403 (note the underscore) in <TT
407 You must either edit <TT
414 > to make them consistent.</P
416 >NOTE: On many systems you may need to use the
417 "interfaces" option in smb.conf to specify the IP address
418 and netmask of your interfaces. Run <B
422 as root if you don't know what the broadcast is for your
426 > tries to determine it at run
427 time, but fails on some unixes. See the section on "testing nmbd"
428 for a method of finding if you need to do this.</P
430 >!!!WARNING!!! Many unixes only accept around 5
431 parameters on the command line in <TT
435 This means you shouldn't use spaces between the options and
436 arguments, or you should use a script, and start the script
446 it a HUP. If you have installed an earlier version of <B
449 > then you may need to kill nmbd as well.</P
456 NAME="AEN129">1.6.2. Alternative: starting it as a daemon</H2
458 >To start the server as a daemon you should create
459 a script something like this one, perhaps calling
466 CLASS="PROGRAMLISTING"
468 /usr/local/samba/bin/smbd -D
469 /usr/local/samba/bin/nmbd -D
473 >then make it executable with <B
483 hand or execute it from <TT
489 >To kill it send a kill signal to the processes
498 >NOTE: If you use the SVR4 style init system then
499 you may like to look at the <TT
501 >examples/svr4-startup</TT
503 script to make Samba fit into that system.</P
511 NAME="AEN145">1.7. Try listing the shares available on your
530 >You should get back a list of shares available on
531 your server. If you don't then something is incorrectly setup.
532 Note that this method can also be used to see what shares
533 are available on other LanManager clients (such as WfWg).</P
535 >If you choose user level security then you may find
536 that Samba requests a password before it will list the shares.
540 > man page for details. (you
541 can force it to list the shares without a password by
542 adding the option -U% to the command line. This will not work
543 with non-Samba servers)</P
550 NAME="AEN154">1.8. Try connecting with the unix client</H1
561 > //yourhostname/aservice</I
573 would be the name of the host where you installed <B
582 any service you have defined in the <TT
586 file. Try your user name if you just have a [homes] section
592 >For example if your unix host is bambi and your login
593 name is fred you would type:</P
601 >smbclient //bambi/fred
611 NAME="AEN170">1.9. Try connecting from a DOS, WfWg, Win9x, WinNT,
612 Win2k, OS/2, etc... client</H1
614 >Try mounting disks. eg:</P
618 >C:\WINDOWS\> </TT
622 >net use d: \\servername\service
627 >Try printing. eg:</P
631 >C:\WINDOWS\> </TT
636 \\servername\spoolservice</B
642 >C:\WINDOWS\> </TT
651 >Celebrate, or send me a bug report!</P
658 NAME="AEN184">1.10. What If Things Don't Work?</H1
660 >If nothing works and you start to think "who wrote
661 this pile of trash" then I suggest you do step 2 again (and
662 again) till you calm down.</P
664 >Then you might read the file DIAGNOSIS.txt and the
665 FAQ. If you are still stuck then try the mailing list or
666 newsgroup (look in the README for details). Samba has been
667 successfully installed at thousands of sites worldwide, so maybe
668 someone else has hit your problem and has overcome it. You could
669 also use the WWW site to scan back issues of the samba-digest.</P
671 >When you fix the problem PLEASE send me some updates to the
672 documentation (or source code) so that the next person will find it
679 NAME="AEN189">1.10.1. Diagnosing Problems</H2
681 >If you have installation problems then go to the
683 HREF="Diagnosis.html"
686 > chapter to try to find the
694 NAME="AEN193">1.10.2. Scope IDs</H2
696 >By default Samba uses a blank scope ID. This means
697 all your windows boxes must also have a blank scope ID.
698 If you really want to use a non-blank scope ID then you will
699 need to use the 'netbios scope' smb.conf option.
700 All your PCs will need to have the same setting for
701 this to work. I do not recommend scope IDs.</P
708 NAME="AEN196">1.10.3. Choosing the Protocol Level</H2
710 >The SMB protocol has many dialects. Currently
711 Samba supports 5, called CORE, COREPLUS, LANMAN1,
714 >You can choose what maximum protocol to support
718 > file. The default is
719 NT1 and that is the best for the vast majority of sites.</P
721 >In older versions of Samba you may have found it
722 necessary to use COREPLUS. The limitations that led to
723 this have mostly been fixed. It is now less likely that you
724 will want to use less than LANMAN1. The only remaining advantage
725 of COREPLUS is that for some obscure reason WfWg preserves
726 the case of passwords in this protocol, whereas under LANMAN1,
727 LANMAN2 or NT1 it uppercases all passwords before sending them,
728 forcing you to use the "password level=" option in some cases.</P
730 >The main advantage of LANMAN2 and NT1 is support for
731 long filenames with some clients (eg: smbclient, Windows NT
734 >See the smb.conf(5) manual page for more details.</P
736 >Note: To support print queue reporting you may find
737 that you have to use TCP/IP as the default protocol under
738 WfWg. For some reason if you leave Netbeui as the default
739 it may break the print queue reporting on some systems.
740 It is presumably a WfWg bug.</P
747 NAME="AEN205">1.10.4. Printing from UNIX to a Client PC</H2
749 >To use a printer that is available via a smb-based
750 server from a unix host with LPR you will need to compile the
751 smbclient program. You then need to install the script
752 "smbprint". Read the instruction in smbprint for more details.
755 >There is also a SYSV style script that does much
756 the same thing called smbprint.sysv. It contains instructions.</P
758 >See the CUPS manual for information about setting up
759 printing from a unix host with CUPS to a smb-based server. </P
766 NAME="AEN210">1.10.5. Locking</H2
768 >One area which sometimes causes trouble is locking.</P
770 >There are two types of locking which need to be
771 performed by a SMB server. The first is "record locking"
772 which allows a client to lock a range of bytes in a open file.
773 The second is the "deny modes" that are specified when a file
776 >Record locking semantics under Unix is very
777 different from record locking under Windows. Versions
778 of Samba before 2.2 have tried to use the native
779 fcntl() unix system call to implement proper record
780 locking between different Samba clients. This can not
781 be fully correct due to several reasons. The simplest
782 is the fact that a Windows client is allowed to lock a
783 byte range up to 2^32 or 2^64, depending on the client
784 OS. The unix locking only supports byte ranges up to
785 2^31. So it is not possible to correctly satisfy a
786 lock request above 2^31. There are many more
787 differences, too many to be listed here.</P
789 >Samba 2.2 and above implements record locking
790 completely independent of the underlying unix
791 system. If a byte range lock that the client requests
792 happens to fall into the range 0-2^31, Samba hands
793 this request down to the Unix system. All other locks
794 can not be seen by unix anyway.</P
796 >Strictly a SMB server should check for locks before
797 every read and write call on a file. Unfortunately with the
798 way fcntl() works this can be slow and may overstress the
799 rpc.lockd. It is also almost always unnecessary as clients
800 are supposed to independently make locking calls before reads
801 and writes anyway if locking is important to them. By default
802 Samba only makes locking calls when explicitly asked
803 to by a client, but if you set "strict locking = yes" then it will
804 make lock checking calls on every read and write. </P
806 >You can also disable by range locking completely
807 using "locking = no". This is useful for those shares that
808 don't support locking or don't need it (such as cdroms). In
809 this case Samba fakes the return codes of locking calls to
810 tell clients that everything is OK.</P
812 >The second class of locking is the "deny modes". These
813 are set by an application when it opens a file to determine
814 what types of access should be allowed simultaneously with
815 its open. A client may ask for DENY_NONE, DENY_READ, DENY_WRITE
816 or DENY_ALL. There are also special compatibility modes called
817 DENY_FCB and DENY_DOS.</P
824 NAME="AEN219">1.10.6. Mapping Usernames</H2
826 >If you have different usernames on the PCs and
827 the unix server then take a look at the "username map" option.
828 See the smb.conf man page for details.</P
837 SUMMARY="Footer navigation table"
848 HREF="introduction.html"
857 HREF="samba-howto-collection.html"
866 HREF="improved-browsing.html"
876 >General installation</TD
882 HREF="introduction.html"
890 >Improved browsing in samba</TD