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.77+"><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
85 >1.1. Read the man pages</H1
87 >The man pages distributed with SAMBA contain
88 lots of useful info that will help to get you started.
89 If you don't know how to read man pages then try
108 >nroff -man smbd.8 | more
111 > on older unixes.</P
113 >Other sources of information are pointed to
114 by the Samba web site,<A
115 HREF="http://www.samba.org/"
117 > http://www.samba.org</A
127 >1.2. Building the Binaries</H1
129 >To do this, first run the program <B
133 > in the source directory. This should automatically
134 configure Samba for your operating system. If you have unusual
135 needs then you may wish to run</P
148 >first to see what special options you can enable.
161 >will create the binaries. Once it's successfully
162 compiled you can use </P
174 >to install the binaries and manual pages. You can
175 separately install the binaries and/or man pages using</P
201 >Note that if you are upgrading for a previous version
202 of Samba you might like to know that the old versions of
203 the binaries will be renamed with a ".old" extension. You
204 can go back to the previous version with</P
217 >if you find this version a disaster!</P
226 >1.3. The all important step</H1
228 >At this stage you must fetch yourself a
229 coffee or other drink you find stimulating. Getting the rest
230 of the install right can sometimes be tricky, so you will
233 >If you have installed samba before then you can skip
243 >1.4. Create the smb configuration file.</H1
245 >There are sample configuration files in the examples
246 subdirectory in the distribution. I suggest you read them
247 carefully so you can see how the options go together in
248 practice. See the man page for all the options.</P
250 >The simplest useful configuration file would be
251 something like this:</P
254 CLASS="PROGRAMLISTING"
264 >which would allow connections by anyone with an
265 account on the server, using either their login name or
266 "homes" as the service name. (Note that I also set the
267 workgroup that Samba is part of. See BROWSING.txt for details)</P
276 > file. You need to create it
279 >Make sure you put the smb.conf file in the same place
280 you specified in the<TT
286 >/usr/local/samba/lib/</TT
289 >For more information about security settings for the
290 [homes] share please refer to the document UNIX_SECURITY.txt.</P
299 >1.5. Test your config file with
305 >It's important that you test the validity of your
309 > file using the testparm program.
310 If testparm runs OK then it will list the loaded services. If
311 not it will give an error message.</P
313 >Make sure it runs OK and that the services look
314 reasonable before proceeding. </P
316 >Always run testparm again when you change
329 >1.6. Starting the smbd and nmbd</H1
331 >You must choose to start smbd and nmbd either
332 as daemons or from <B
336 to do both! Either you can put them in <TT
339 > and have them started on demand
343 >, or you can start them as
344 daemons either from the command line or in <TT
347 >. See the man pages for details
348 on the command line options. Take particular care to read
349 the bit about what user you need to be in order to start
350 Samba. In many cases you must be root.</P
352 >The main advantage of starting <B
359 > using the recommended daemon method
360 is that they will respond slightly more quickly to an initial connection
369 >1.6.1. Starting from inetd.conf</H2
371 >NOTE; The following will be different if
372 you use NIS or NIS+ to distributed services maps.</P
378 What is defined at port 139/tcp. If nothing is defined
379 then add a line like this:</P
384 >netbios-ssn 139/tcp</B
388 >similarly for 137/udp you should have an entry like:</P
393 >netbios-ns 137/udp</B
401 and add two lines something like this:</P
404 CLASS="PROGRAMLISTING"
405 > netbios-ssn stream tcp nowait root /usr/local/samba/bin/smbd smbd
406 netbios-ns dgram udp wait root /usr/local/samba/bin/nmbd nmbd
410 >The exact syntax of <TT
414 varies between unixes. Look at the other entries in inetd.conf
417 >NOTE: Some unixes already have entries like netbios_ns
418 (note the underscore) in <TT
422 You must either edit <TT
429 > to make them consistent.</P
431 >NOTE: On many systems you may need to use the
432 "interfaces" option in smb.conf to specify the IP address
433 and netmask of your interfaces. Run <B
437 as root if you don't know what the broadcast is for your
441 > tries to determine it at run
442 time, but fails on some unixes. See the section on "testing nmbd"
443 for a method of finding if you need to do this.</P
445 >!!!WARNING!!! Many unixes only accept around 5
446 parameters on the command line in <TT
450 This means you shouldn't use spaces between the options and
451 arguments, or you should use a script, and start the script
461 it a HUP. If you have installed an earlier version of <B
464 > then you may need to kill nmbd as well.</P
473 >1.6.2. Alternative: starting it as a daemon</H2
475 >To start the server as a daemon you should create
476 a script something like this one, perhaps calling
483 CLASS="PROGRAMLISTING"
485 /usr/local/samba/bin/smbd -D
486 /usr/local/samba/bin/nmbd -D
490 >then make it executable with <B
500 hand or execute it from <TT
506 >To kill it send a kill signal to the processes
515 >NOTE: If you use the SVR4 style init system then
516 you may like to look at the <TT
518 >examples/svr4-startup</TT
520 script to make Samba fit into that system.</P
530 >1.7. Try listing the shares available on your
549 >You should get back a list of shares available on
550 your server. If you don't then something is incorrectly setup.
551 Note that this method can also be used to see what shares
552 are available on other LanManager clients (such as WfWg).</P
554 >If you choose user level security then you may find
555 that Samba requests a password before it will list the shares.
559 > man page for details. (you
560 can force it to list the shares without a password by
561 adding the option -U% to the command line. This will not work
562 with non-Samba servers)</P
571 >1.8. Try connecting with the unix client</H1
582 > //yourhostname/aservice</I
594 would be the name of the host where you installed <B
603 any service you have defined in the <TT
607 file. Try your user name if you just have a [homes] section
613 >For example if your unix host is bambi and your login
614 name is fred you would type:</P
622 >smbclient //bambi/fred
634 >1.9. Try connecting from a DOS, WfWg, Win9x, WinNT,
635 Win2k, OS/2, etc... client</H1
637 >Try mounting disks. eg:</P
641 >C:\WINDOWS\> </TT
645 >net use d: \\servername\service
650 >Try printing. eg:</P
654 >C:\WINDOWS\> </TT
659 \\servername\spoolservice</B
665 >C:\WINDOWS\> </TT
674 >Celebrate, or send me a bug report!</P
683 >1.10. What If Things Don't Work?</H1
685 >If nothing works and you start to think "who wrote
686 this pile of trash" then I suggest you do step 2 again (and
687 again) till you calm down.</P
689 >Then you might read the file DIAGNOSIS.txt and the
690 FAQ. If you are still stuck then try the mailing list or
691 newsgroup (look in the README for details). Samba has been
692 successfully installed at thousands of sites worldwide, so maybe
693 someone else has hit your problem and has overcome it. You could
694 also use the WWW site to scan back issues of the samba-digest.</P
696 >When you fix the problem PLEASE send me some updates to the
697 documentation (or source code) so that the next person will find it
706 >1.10.1. Diagnosing Problems</H2
708 >If you have installation problems then go to the
710 HREF="Diagnosis.html"
713 > chapter to try to find the
723 >1.10.2. Scope IDs</H2
725 >By default Samba uses a blank scope ID. This means
726 all your windows boxes must also have a blank scope ID.
727 If you really want to use a non-blank scope ID then you will
728 need to use the 'netbios scope' smb.conf option.
729 All your PCs will need to have the same setting for
730 this to work. I do not recommend scope IDs.</P
739 >1.10.3. Choosing the Protocol Level</H2
741 >The SMB protocol has many dialects. Currently
742 Samba supports 5, called CORE, COREPLUS, LANMAN1,
745 >You can choose what maximum protocol to support
749 > file. The default is
750 NT1 and that is the best for the vast majority of sites.</P
752 >In older versions of Samba you may have found it
753 necessary to use COREPLUS. The limitations that led to
754 this have mostly been fixed. It is now less likely that you
755 will want to use less than LANMAN1. The only remaining advantage
756 of COREPLUS is that for some obscure reason WfWg preserves
757 the case of passwords in this protocol, whereas under LANMAN1,
758 LANMAN2 or NT1 it uppercases all passwords before sending them,
759 forcing you to use the "password level=" option in some cases.</P
761 >The main advantage of LANMAN2 and NT1 is support for
762 long filenames with some clients (eg: smbclient, Windows NT
765 >See the smb.conf(5) manual page for more details.</P
767 >Note: To support print queue reporting you may find
768 that you have to use TCP/IP as the default protocol under
769 WfWg. For some reason if you leave Netbeui as the default
770 it may break the print queue reporting on some systems.
771 It is presumably a WfWg bug.</P
780 >1.10.4. Printing from UNIX to a Client PC</H2
782 >To use a printer that is available via a smb-based
783 server from a unix host with LPR you will need to compile the
784 smbclient program. You then need to install the script
785 "smbprint". Read the instruction in smbprint for more details.
788 >There is also a SYSV style script that does much
789 the same thing called smbprint.sysv. It contains instructions.</P
791 >See the CUPS manual for information about setting up
792 printing from a unix host with CUPS to a smb-based server. </P
803 >One area which sometimes causes trouble is locking.</P
805 >There are two types of locking which need to be
806 performed by a SMB server. The first is "record locking"
807 which allows a client to lock a range of bytes in a open file.
808 The second is the "deny modes" that are specified when a file
811 >Record locking semantics under Unix is very
812 different from record locking under Windows. Versions
813 of Samba before 2.2 have tried to use the native
814 fcntl() unix system call to implement proper record
815 locking between different Samba clients. This can not
816 be fully correct due to several reasons. The simplest
817 is the fact that a Windows client is allowed to lock a
818 byte range up to 2^32 or 2^64, depending on the client
819 OS. The unix locking only supports byte ranges up to
820 2^31. So it is not possible to correctly satisfy a
821 lock request above 2^31. There are many more
822 differences, too many to be listed here.</P
824 >Samba 2.2 and above implements record locking
825 completely independent of the underlying unix
826 system. If a byte range lock that the client requests
827 happens to fall into the range 0-2^31, Samba hands
828 this request down to the Unix system. All other locks
829 can not be seen by unix anyway.</P
831 >Strictly a SMB server should check for locks before
832 every read and write call on a file. Unfortunately with the
833 way fcntl() works this can be slow and may overstress the
834 rpc.lockd. It is also almost always unnecessary as clients
835 are supposed to independently make locking calls before reads
836 and writes anyway if locking is important to them. By default
837 Samba only makes locking calls when explicitly asked
838 to by a client, but if you set "strict locking = yes" then it will
839 make lock checking calls on every read and write. </P
841 >You can also disable by range locking completely
842 using "locking = no". This is useful for those shares that
843 don't support locking or don't need it (such as cdroms). In
844 this case Samba fakes the return codes of locking calls to
845 tell clients that everything is OK.</P
847 >The second class of locking is the "deny modes". These
848 are set by an application when it opens a file to determine
849 what types of access should be allowed simultaneously with
850 its open. A client may ask for DENY_NONE, DENY_READ, DENY_WRITE
851 or DENY_ALL. There are also special compatibility modes called
852 DENY_FCB and DENY_DOS.</P
861 >1.10.6. Mapping Usernames</H2
863 >If you have different usernames on the PCs and
864 the unix server then take a look at the "username map" option.
865 See the smb.conf man page for details.</P
874 SUMMARY="Footer navigation table"
885 HREF="introduction.html"
894 HREF="samba-howto-collection.html"
903 HREF="browsing-quick.html"
913 >General installation</TD
919 HREF="introduction.html"
927 >Quick Cross Subnet Browsing / Cross Workgroup Browsing guide</TD