1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <html><head><meta http-equiv=
"Content-Type" content=
"text/html; charset=ISO-8859-1"><title>Chapter
2. How to Install and Test SAMBA
</title><link rel=
"stylesheet" href=
"samba.css" type=
"text/css"><meta name=
"generator" content=
"DocBook XSL Stylesheets V1.59.1"><link rel=
"home" href=
"index.html" title=
"SAMBA Project Documentation"><link rel=
"up" href=
"introduction.html" title=
"Part I. General Installation"><link rel=
"previous" href=
"IntroSMB.html" title=
"Chapter 1. Introduction to Samba"><link rel=
"next" href=
"type.html" title=
"Part II. Server Configuration Basics"></head><body bgcolor=
"white" text=
"black" link=
"#0000FF" vlink=
"#840084" alink=
"#0000FF"><div class=
"navheader"><table width=
"100%" summary=
"Navigation header"><tr><th colspan=
"3" align=
"center">Chapter
2. How to Install and Test SAMBA
</th></tr><tr><td width=
"20%" align=
"left"><a accesskey=
"p" href=
"IntroSMB.html">Prev
</a> </td><th width=
"60%" align=
"center">Part I. General Installation
</th><td width=
"20%" align=
"right"> <a accesskey=
"n" href=
"type.html">Next
</a></td></tr></table><hr></div><div class=
"chapter" lang=
"en"><div class=
"titlepage"><div><h2 class=
"title"><a name=
"install"></a>Chapter
2. How to Install and Test SAMBA
</h2></div><div><div class=
"author"><h3 class=
"author">Andrew Tridgell
</h3><div class=
"affiliation"><span class=
"orgname">Samba Team
<br></span><div class=
"address"><p><tt><<a href=
"mailto:tridge@samba.org">tridge@samba.org
</a>></tt></p></div></div></div></div><div><div class=
"author"><h3 class=
"author">Jelmer R. Vernooij
</h3><div class=
"affiliation"><span class=
"orgname">The Samba Team
<br></span><div class=
"address"><p><tt><<a href=
"mailto:jelmer@samba.org">jelmer@samba.org
</a>></tt></p></div></div></div></div><div><div class=
"author"><h3 class=
"author">Karl Auer
</h3></div></div></div><div class=
"toc"><p><b>Table of Contents
</b></p><dl><dt><a href=
"install.html#id2812103">Obtaining and installing samba
</a></dt><dt><a href=
"install.html#id2812254">Configuring samba
</a></dt><dd><dl><dt><a href=
"install.html#id2812000">Editing the smb.conf file
</a></dt><dt><a href=
"install.html#id2875811">SWAT
</a></dt></dl></dd><dt><a href=
"install.html#id2875850">Try listing the shares available on your
3 server
</a></dt><dt><a href=
"install.html#id2875900">Try connecting with the unix client
</a></dt><dt><a href=
"install.html#id2876004">Try connecting from a DOS, WfWg, Win9x, WinNT,
4 Win2k, OS/
2, etc... client
</a></dt><dt><a href=
"install.html#id2876065">What If Things Don't Work?
</a></dt></dl></div><div class=
"sect1" lang=
"en"><div class=
"titlepage"><div><h2 class=
"title" style=
"clear: both"><a name=
"id2812103"></a>Obtaining and installing samba
</h2></div></div><p>Binary packages of samba are included in almost any Linux or
5 Unix distribution. There are also some packages available at
6 <a href=
"http://samba.org/" target=
"_top">the samba homepage
</a>.
7 </p><p>If you need to compile samba from source, check the
8 <a href=
"compiling.html" title=
"Chapter 30. How to compile SAMBA">appropriate appendix chapter
</a>.
</p></div><div class=
"sect1" lang=
"en"><div class=
"titlepage"><div><h2 class=
"title" style=
"clear: both"><a name=
"id2812254"></a>Configuring samba
</h2></div></div><p>Samba's configuration is stored in the smb.conf file,
9 that usually resides in
<tt>/etc/samba/smb.conf
</tt>
10 or
<tt>/usr/local/samba/lib/smb.conf
</tt>. You can either
11 edit this file yourself or do it using one of the many graphical
12 tools that are available, such as the web-based interface swat, that
13 is included with samba.
</p><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><h3 class=
"title"><a name=
"id2812000"></a>Editing the
<tt>smb.conf
</tt> file
</h3></div></div><p>There are sample configuration files in the examples
14 subdirectory in the distribution. I suggest you read them
15 carefully so you can see how the options go together in
16 practice. See the man page for all the options.
</p><p>The simplest useful configuration file would be
17 something like this:
</p><pre class=
"programlisting">
24 </pre><p>which would allow connections by anyone with an
25 account on the server, using either their login name or
26 "<b>homes
</b>" as the service name. (Note that I also set the
27 workgroup that Samba is part of. See BROWSING.txt for details)
</p><p>Make sure you put the
<tt>smb.conf
</tt> file in the same place
28 you specified in the
<tt>Makefile
</tt> (the default is to
29 look for it in
<tt>/usr/local/samba/lib/
</tt>).
</p><p>For more information about security settings for the
30 <b>[homes]
</b> share please refer to the chapter
31 <a href=
"securing-samba.html" title=
"Chapter 24. Securing Samba">Securing Samba
</a>.
</p><div class=
"sect3" lang=
"en"><div class=
"titlepage"><div><h4 class=
"title"><a name=
"id2875758"></a>Test your config file with
32 <b>testparm
</b></h4></div></div><p>It's important that you test the validity of your
33 <tt>smb.conf
</tt> file using the testparm program.
34 If testparm runs OK then it will list the loaded services. If
35 not it will give an error message.
</p><p>Make sure it runs OK and that the services look
36 reasonable before proceeding.
</p><p>Always run testparm again when you change
37 <tt>smb.conf
</tt>!
</p></div></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><h3 class=
"title"><a name=
"id2875811"></a>SWAT
</h3></div></div><p>
38 SWAT is a web-based interface that helps you configure samba.
39 SWAT might not be available in the samba package on your platform,
40 but in a separate package. Please read the swat manpage
41 on compiling, installing and configuring swat from source.
42 </p><p>To launch SWAT just run your favorite web browser and
43 point it at
"http://localhost:
901/
". Replace
<i><tt>localhost
</tt></i> with the name of the computer you are running samba on if you
44 are running samba on a different computer than your browser.
</p><p>Note that you can attach to SWAT from any IP connected
45 machine but connecting from a remote machine leaves your
46 connection open to password sniffing as passwords will be sent
47 in the clear over the wire.
</p></div></div><div class=
"sect1" lang=
"en"><div class=
"titlepage"><div><h2 class=
"title" style=
"clear: both"><a name=
"id2875850"></a>Try listing the shares available on your
48 server
</h2></div></div><p><tt>$
</tt><b><tt>smbclient -L
49 <i><tt>yourhostname
</tt></i></tt></b></p><p>You should get back a list of shares available on
50 your server. If you don't then something is incorrectly setup.
51 Note that this method can also be used to see what shares
52 are available on other LanManager clients (such as WfWg).
</p><p>If you choose user level security then you may find
53 that Samba requests a password before it will list the shares.
54 See the
<b>smbclient
</b> man page for details. (you
55 can force it to list the shares without a password by
56 adding the option -U% to the command line. This will not work
57 with non-Samba servers)
</p></div><div class=
"sect1" lang=
"en"><div class=
"titlepage"><div><h2 class=
"title" style=
"clear: both"><a name=
"id2875900"></a>Try connecting with the unix client
</h2></div></div><p><tt>$
</tt><b><tt>smbclient
<i><tt>
58 //yourhostname/aservice
</tt></i></tt></b></p><p>Typically the
<i><tt>yourhostname
</tt></i>
59 would be the name of the host where you installed smbd.
60 The
<i><tt>aservice
</tt></i> is
61 any service you have defined in the
<tt>smb.conf
</tt>
62 file. Try your user name if you just have a
<b>[homes]
</b>
64 in
<tt>smb.conf
</tt>.
</p><p>For example if your unix host is
<i><tt>bambi
</tt></i>
65 and your login name is
<i><tt>fred
</tt></i> you would type:
</p><p><tt>$
</tt><b><tt>smbclient //
<i><tt>bambi
</tt></i>/
<i><tt>fred
</tt></i>
66 </tt></b></p></div><div class=
"sect1" lang=
"en"><div class=
"titlepage"><div><h2 class=
"title" style=
"clear: both"><a name=
"id2876004"></a>Try connecting from a DOS, WfWg, Win9x, WinNT,
67 Win2k, OS/
2, etc... client
</h2></div></div><p>Try mounting disks. eg:
</p><p><tt>C:\WINDOWS\
> </tt><b><tt>net use d: \\servername\service
68 </tt></b></p><p>Try printing. eg:
</p><p><tt>C:\WINDOWS\
> </tt><b><tt>net use lpt1:
69 \\servername\spoolservice
</tt></b></p><p><tt>C:\WINDOWS\
> </tt><b><tt>print filename
70 </tt></b></p></div><div class=
"sect1" lang=
"en"><div class=
"titlepage"><div><h2 class=
"title" style=
"clear: both"><a name=
"id2876065"></a>What If Things Don't Work?
</h2></div></div><p>Then you might read the file chapter
71 <a href=
"diagnosis.html" title=
"Chapter 27. The samba checklist">Diagnosis
</a> and the
72 FAQ. If you are still stuck then try to follow
73 the
<a href=
"problems.html" title=
"Chapter 28. Analysing and solving samba problems">Analysing and Solving Problems chapter
</a>
74 Samba has been successfully installed at thousands of sites worldwide,
75 so maybe someone else has hit your problem and has overcome it.
</p></div></div><div class=
"navfooter"><hr><table width=
"100%" summary=
"Navigation footer"><tr><td width=
"40%" align=
"left"><a accesskey=
"p" href=
"IntroSMB.html">Prev
</a> </td><td width=
"20%" align=
"center"><a accesskey=
"u" href=
"introduction.html">Up
</a></td><td width=
"40%" align=
"right"> <a accesskey=
"n" href=
"type.html">Next
</a></td></tr><tr><td width=
"40%" align=
"left" valign=
"top">Chapter
1. Introduction to Samba
</td><td width=
"20%" align=
"center"><a accesskey=
"h" href=
"index.html">Home
</a></td><td width=
"40%" align=
"right" valign=
"top"> Part II. Server Configuration Basics
</td></tr></table></div></body></html>