update smbldap-tool sscripts from Jérôme Tournier
[bbaumbach/samba-autobuild/.git] / docs / htmldocs / SWAT.html
1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 32. SWAT - The Samba Web Administration Tool</title><link rel="stylesheet" href="samba.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"><link rel="home" href="samba-doc.html" title="SAMBA Project Documentation"><link rel="up" href="migration.html" title="Part IV. Migration and Updating"><link rel="previous" href="NT4Migration.html" title="Chapter 31. Migration from NT4 PDC to Samba-3 PDC"><link rel="next" href="troubleshooting.html" title="Part V. Troubleshooting"></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 32. SWAT - The Samba Web Administration Tool</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="NT4Migration.html">Prev</a> </td><th width="60%" align="center">Part IV. Migration and Updating</th><td width="20%" align="right"> <a accesskey="n" href="troubleshooting.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="SWAT"></a>Chapter 32. SWAT - The Samba Web Administration Tool</h2></div><div><div class="author"><h3 class="author"><span class="firstname">John</span> <span class="othername">H.</span> <span class="surname">Terpstra</span></h3><div class="affiliation"><span class="orgname">Samba Team<br></span><div class="address"><p><tt class="email">&lt;<a href="mailto:jht@samba.org">jht@samba.org</a>&gt;</tt></p></div></div></div></div><div><p class="pubdate">April 21, 2003</p></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="SWAT.html#id2957030">Features and Benefits</a></dt><dd><dl><dt><a href="SWAT.html#id2957079">Enabling SWAT for use</a></dt><dt><a href="SWAT.html#id2957316">Securing SWAT through SSL</a></dt><dt><a href="SWAT.html#id2957428">The SWAT Home Page</a></dt><dt><a href="SWAT.html#id2957493">Global Settings</a></dt><dt><a href="SWAT.html#id2957601">Share Settings</a></dt><dt><a href="SWAT.html#id2957665">Printers Settings</a></dt><dt><a href="SWAT.html#id2957730">The SWAT Wizard</a></dt><dt><a href="SWAT.html#id2957777">The Status Page</a></dt><dt><a href="SWAT.html#id2957829">The View Page</a></dt><dt><a href="SWAT.html#id2957853">The Password Change Page</a></dt></dl></dd></dl></div><p>
2 There are many and varied opinions regarding the usefulness or otherwise of SWAT.
3 No matter how hard one tries to produce the perfect configuration tool it remains
4 an object of personal taste. SWAT is a tool that will allow web based configuration
5 of samba. It has a wizard that may help to get samba configured quickly, it has context
6 sensitive help on each smb.conf parameter, it provides for monitoring of current state
7 of connection information, and it allows network wide MS Windows network password
8 management.
9 </p><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2957030"></a>Features and Benefits</h2></div></div><div></div></div><p>
10 There are network administrators who believe that it is a good idea to write systems
11 documentation inside configuration files, for them SWAT will aways be a nasty tool. SWAT
12 does not store the configuration file in any intermediate form, rather, it stores only the
13 parameter settings, so when SWAT writes the smb.conf file to disk it will write only
14 those parameters that are at other than the default settings. The result is that all comments
15 will be lost from the <tt class="filename">smb.conf</tt> file. Additionally, the parameters will be written back in
16 internal ordering.
17 </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
18 So before using SWAT please be warned - SWAT will completely replace your smb.conf with
19 a fully optimised file that has been stripped of all comments you might have placed there
20 and only non-default settings will be written to the file.
21 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2957079"></a>Enabling SWAT for use</h3></div></div><div></div></div><p>
22 SWAT should be installed to run via the network super daemon. Depending on which system
23 your UNIX/Linux system has you will have either an <b class="command">inetd</b> or
24 <b class="command">xinetd</b> based system.
25 </p><p>
26 The nature and location of the network super-daemon varies with the operating system
27 implementation. The control file (or files) can be located in the file 
28 <tt class="filename">/etc/inetd.conf</tt> or in the directory <tt class="filename">/etc/[x]inet.d</tt>
29 or similar.
30 </p><p>
31 The control entry for the older style file might be:
32 </p><pre class="programlisting">
33         # swat is the Samba Web Administration Tool
34         swat stream tcp nowait.400 root /usr/sbin/swat swat
35 </pre><p>
36 A control file for the newer style xinetd could be:
37 </p><p>
38 </p><pre class="programlisting">
39         # default: off
40         # description: SWAT is the Samba Web Admin Tool. Use swat \
41         #              to configure your Samba server. To use SWAT, \
42         #              connect to port 901 with your favorite web browser.
43         service swat
44         {
45                 port    = 901
46                 socket_type     = stream
47                 wait    = no
48                 only_from = localhost
49                 user    = root
50                 server  = /usr/sbin/swat
51                 log_on_failure  += USERID
52                 disable = yes
53         }
54 </pre><p>
55
56 </p><p>
57 Both the above examples assume that the <b class="command">swat</b> binary has been
58 located in the <tt class="filename">/usr/sbin</tt> directory. In addition to the above
59 SWAT will use a directory access point from which it will load it's help files
60 as well as other control information. The default location for this on most Linux
61 systems is in the directory <tt class="filename">/usr/share/samba/swat</tt>. The default
62 location using samba defaults will be <tt class="filename">/usr/local/samba/swat</tt>.
63 </p><p>
64 Access to SWAT will prompt for a logon. If you log onto SWAT as any non-root user
65 the only permission allowed is to view certain aspects of configuration as well as
66 access to the password change facility. The buttons that will be exposed to the non-root
67 user are: <span class="guibutton">HOME</span>, <span class="guibutton">STATUS</span>, <span class="guibutton">VIEW</span>, 
68 <span class="guibutton">PASSWORD</span>. The only page that allows
69 change capability in this case is <span class="guibutton">PASSWORD</span>.
70 </p><p>
71 So long as you log onto SWAT as the user <span class="emphasis"><em>root</em></span> you should obtain
72 full change and commit ability. The buttons that will be exposed includes:
73 <span class="guibutton">HOME</span>, <span class="guibutton">GLOBALS</span>, <span class="guibutton">SHARES</span>, <span class="guibutton">PRINTERS</span>, 
74 <span class="guibutton">WIZARD</span>, <span class="guibutton">STATUS</span>, <span class="guibutton">VIEW</span>, <span class="guibutton">PASSWORD</span>.
75 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2957316"></a>Securing SWAT through SSL</h3></div></div><div></div></div><p>
76 Lots of people have asked about how to setup SWAT with SSL to allow for secure remote
77 administration of Samba. Here is a method that works, courtesy of Markus Krieger
78 </p><p>
79 Modifications to the swat setup are as following: 
80 </p><div class="procedure"><ol type="1"><li><p>
81         install OpenSSL 
82         </p></li><li><p>
83         generate certificate and private key
84
85 </p><pre class="screen">
86 <tt class="prompt">root# </tt><b class="userinput"><tt>/usr/bin/openssl req -new -x509 -days 365 -nodes -config \
87         /usr/share/doc/packages/stunnel/stunnel.cnf \
88         -out /etc/stunnel/stunnel.pem -keyout /etc/stunnel/stunnel.pem</tt></b>
89 </pre></li><li><p>
90         remove swat-entry from [x]inetd 
91         </p></li><li><p>
92         start stunnel
93
94 </p><pre class="screen">
95 <tt class="prompt">root# </tt><b class="userinput"><tt>stunnel -p /etc/stunnel/stunnel.pem -d 901 \
96          -l /usr/local/samba/bin/swat swat </tt></b>
97 </pre></li></ol></div><p>
98 afterwords simply contact to swat by using the URL <a href="https://myhost:901" target="_top">https://myhost:901</a>, accept the certificate
99 and the SSL connection is up.
100 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2957428"></a>The SWAT Home Page</h3></div></div><div></div></div><p>
101 The SWAT title page provides access to the latest Samba documentation. The manual page for
102 each samba component is accessible from this page as are the Samba-HOWTO-Collection (this 
103 document) as well as the O'Reilly book &quot;Using Samba&quot;.
104 </p><p>
105 Administrators who wish to validate their samba configuration may obtain useful information
106 from the man pages for the diagnostic utilities. These are available from the SWAT home page
107 also. One diagnostic tool that is NOT mentioned on this page, but that is particularly
108 useful is <a href="http://www.ethereal.com/" target="_top"><b class="command">ethereal</b></a>.
109 </p><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>
110 SWAT can be configured to run in <span class="emphasis"><em>demo</em></span> mode. This is NOT recommended
111 as it runs SWAT without authentication and with full administrative ability. ie: Allows
112 changes to smb.conf as well as general operation with root privileges. The option that
113 creates this ability is the <tt class="option">-a</tt> flag to swat. <span class="emphasis"><em>Do not use this in any 
114 production environment.</em></span>
115 </p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2957493"></a>Global Settings</h3></div></div><div></div></div><p>
116 The Globals button will expose a page that allows configuration of the global parameters
117 in smb.conf. There are three levels of exposure of the parameters:
118 </p><div class="itemizedlist"><ul type="disc"><li><p>
119         <span class="emphasis"><em>Basic</em></span> - exposes common configuration options.
120         </p></li><li><p>
121         <span class="emphasis"><em>Advanced</em></span> - exposes  configuration options needed in more 
122         complex environments.
123         </p></li><li><p>
124         <span class="emphasis"><em>Developer</em></span> - exposes configuration options that only the brave
125         will want to tamper with.
126         </p></li></ul></div><p>
127 To switch to other than <span class="emphasis"><em>Basic</em></span> editing ability click on either the
128 <span class="emphasis"><em>Advanced</em></span> or the <span class="emphasis"><em>Developer</em></span> button. You may also
129 do this by clicking on the radio button, then click the <span class="guibutton">Commit Changes</span> button.
130 </p><p>
131 After making any changes to configuration parameters make sure that you click on the 
132 <span class="guibutton">Commit Changes</span> button before moving to another area otherwise
133 your changes will be immediately lost.
134 </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
135 SWAT has context sensitive help. To find out what each parameter is for simply click the
136 <span class="guibutton">Help</span> link to the left of the configuration parameter.
137 </p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2957601"></a>Share Settings</h3></div></div><div></div></div><p>
138 To affect a currently configured share, simply click on the pull down button between the
139 <span class="guibutton">Choose Share</span> and the <span class="guibutton">Delete Share</span> buttons,
140 select the share you wish to operate on, then to edit the settings click on the
141 <span class="guibutton">Choose Share</span> button, to delete the share simply press the
142 <span class="guibutton">Delete Share</span> button.
143 </p><p>
144 To create a new share, next to the button labelled <span class="guibutton">Create Share</span> enter
145 into the text field the name of the share to be created, then click on the 
146 <span class="guibutton">Create Share</span> button.
147 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2957665"></a>Printers Settings</h3></div></div><div></div></div><p>
148 To affect a currently configured printer, simply click on the pull down button between the
149 <span class="guibutton">Choose Printer</span> and the <span class="guibutton">Delete Printer</span> buttons,
150 select the printer you wish to operate on, then to edit the settings click on the
151 <span class="guibutton">Choose Printer</span> button, to delete the share simply press the
152 <span class="guibutton">Delete Printer</span> button.
153 </p><p>
154 To create a new printer, next to the button labelled <span class="guibutton">Create Printer</span> enter
155 into the text field the name of the share to be created, then click on the 
156 <span class="guibutton">Create Printer</span> button.
157 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2957730"></a>The SWAT Wizard</h3></div></div><div></div></div><p>
158 The purpose if the SWAT Wizard is to help the Microsoft knowledgeable network administrator
159 to configure Samba with a minimum of effort.
160 </p><p>
161 The Wizard page provides a tool for rewriting the smb.conf file in fully optimised format.
162 This will also happen if you press the commit button. The two differ in the the rewrite button
163 ignores any changes that may have been made, while the Commit button causes all changes to be
164 affected.
165 </p><p>
166 The <span class="guibutton">Edit</span> button permits the editing (setting) of the minimal set of
167 options that may be necessary to create a working Samba server.
168 </p><p>
169 Finally, there are a limited set of options that will determine what type of server Samba
170 will be configured for, whether it will be a WINS server, participate as a WINS client, or
171 operate with no WINS support. By clicking on one button you can elect to expose (or not) user
172 home directories.
173 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2957777"></a>The Status Page</h3></div></div><div></div></div><p>
174 The status page serves a limited purpose. Firstly, it allows control of the samba daemons.
175 The key daemons that create the samba server environment are: <span class="application">smbd</span>, <span class="application">nmbd</span>, <span class="application">winbindd</span>.
176 </p><p>
177 The daemons may be controlled individually or as a total group. Additionally, you may set
178 an automatic screen refresh timing. As MS Windows clients interact with Samba new smbd processes
179 will be continually spawned. The auto-refresh facility will allow you to track the changing
180 conditions with minimal effort.
181 </p><p>
182 Lastly, the Status page may be used to terminate specific smbd client connections in order to
183 free files that may be locked.
184 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2957829"></a>The View Page</h3></div></div><div></div></div><p>
185 This page allows the administrator to view the optimised <tt class="filename">smb.conf</tt> file and, if you are
186 particularly masochistic, will permit you also to see all possible global configuration
187 parameters and their settings.
188 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2957853"></a>The Password Change Page</h3></div></div><div></div></div><p>
189 The Password Change page is a popular tool. This tool allows the creation, deletion, deactivation
190 and reactivation of MS Windows networking users on the local machine. Alternatively, you can use
191 this tool to change a local password for a user account.
192 </p><p>
193 When logged in as a non-root account the user will have to provide the old password as well as
194 the new password (twice). When logged in as <span class="emphasis"><em>root</em></span> only the new password is
195 required.
196 </p><p>
197 One popular use for this tool is to change user passwords across a range of remote MS Windows
198 servers.
199 </p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="NT4Migration.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="migration.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="troubleshooting.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 31. Migration from NT4 PDC to Samba-3 PDC </td><td width="20%" align="center"><a accesskey="h" href="samba-doc.html">Home</a></td><td width="40%" align="right" valign="top"> Part V. Troubleshooting</td></tr></table></div></body></html>