Last set of syntax fixes
[Samba/gebeck_regimport.git] / docs / docbook / projdoc / SWAT.xml
blob90994f65e0b0326f507bc46c7f4af253bfafcc4d
1 <chapter id="SWAT">
2 <chapterinfo>
3         &author.jht;
4         <pubdate>April 21, 2003</pubdate>
5 </chapterinfo>
7 <title>SWAT - The Samba Web Administration Tool</title>
9 <para>
10 There are many and varied opinions regarding the usefulness or otherwise of SWAT.
11 No matter how hard one tries to produce the perfect configuration tool it remains
12 an object of personal taste. SWAT is a tool that will allow web based configuration
13 of samba. It has a wizard that may help to get samba configured quickly, it has context
14 sensitive help on each smb.conf parameter, it provides for monitoring of current state
15 of connection information, and it allows network wide MS Windows network password
16 management.
17 </para>
19 <sect1>
20 <title>Features and Benefits</title>
22 <para>
23 There are network administrators who believe that it is a good idea to write systems
24 documentation inside configuration files, for them SWAT will aways be a nasty tool. SWAT
25 does not store the configuration file in any intermediate form, rather, it stores only the
26 parameter settings, so when SWAT writes the smb.conf file to disk it will write only
27 those parameters that are at other than the default settings. The result is that all comments
28 will be lost from the &smb.conf; file. Additionally, the parameters will be written back in
29 internal ordering.
30 </para>
32 <note><para>
33 So before using SWAT please be warned - SWAT will completely replace your smb.conf with
34 a fully optimised file that has been stripped of all comments you might have placed there
35 and only non-default settings will be written to the file.
36 </para></note>
38 <sect2>
39 <title>Enabling SWAT for use</title>
41 <para>
42 SWAT should be installed to run via the network super daemon. Depending on which system
43 your UNIX/Linux system has you will have either an <command>inetd</command> or
44 <command>xinetd</command> based system.
45 </para>
47 <para>
48 The nature and location of the network super-daemon varies with the operating system
49 implementation. The control file (or files) can be located in the file 
50 <filename>/etc/inetd.conf</filename> or in the directory <filename>/etc/[x]inet.d</filename>
51 or similar.
52 </para>
54 <para>
55 The control entry for the older style file might be:
56 </para>
58 <para><programlisting>
59         # swat is the Samba Web Administration Tool
60         swat stream tcp nowait.400 root /usr/sbin/swat swat
61 </programlisting></para>
63 <para>
64 A control file for the newer style xinetd could be:
65 </para>
67 <para>
68 <programlisting>
69         # default: off
70         # description: SWAT is the Samba Web Admin Tool. Use swat \
71         #              to configure your Samba server. To use SWAT, \
72         #              connect to port 901 with your favorite web browser.
73         service swat
74         {
75                 port    = 901
76                 socket_type     = stream
77                 wait    = no
78                 only_from = localhost
79                 user    = root
80                 server  = /usr/sbin/swat
81                 log_on_failure  += USERID
82                 disable = yes
83         }
84 </programlisting>
86 </para>
88 <para>
89 Both the above examples assume that the <command>swat</command> binary has been
90 located in the <filename>/usr/sbin</filename> directory. In addition to the above
91 SWAT will use a directory access point from which it will load it's help files
92 as well as other control information. The default location for this on most Linux
93 systems is in the directory <filename>/usr/share/samba/swat</filename>. The default
94 location using samba defaults will be <filename>/usr/local/samba/swat</filename>.
95 </para>
97 <para>
98 Access to SWAT will prompt for a logon. If you log onto SWAT as any non-root user
99 the only permission allowed is to view certain aspects of configuration as well as
100 access to the password change facility. The buttons that will be exposed to the non-root
101 user are: <guibutton>HOME</guibutton>, <guibutton>STATUS</guibutton>, <guibutton>VIEW</guibutton>, 
102 <guibutton>PASSWORD</guibutton>. The only page that allows
103 change capability in this case is <guibutton>PASSWORD</guibutton>.
104 </para>
106 <para>
107 So long as you log onto SWAT as the user <emphasis>root</emphasis> you should obtain
108 full change and commit ability. The buttons that will be exposed includes:
109 <guibutton>HOME</guibutton>, <guibutton>GLOBALS</guibutton>, <guibutton>SHARES</guibutton>, <guibutton>PRINTERS</guibutton>, 
110 <guibutton>WIZARD</guibutton>, <guibutton>STATUS</guibutton>, <guibutton>VIEW</guibutton>, <guibutton>PASSWORD</guibutton>.
111 </para>
113 </sect2>
115 <sect2>
116 <title>Securing SWAT through SSL</title>
118 <para>
119 Lots of people have asked about how to setup SWAT with SSL to allow for secure remote
120 administration of Samba. Here is a method that works, courtesy of Markus Krieger
121 </para>
123 <para>
124 Modifications to the swat setup are as following: 
125 </para>
127 <procedure>
128         <step><para>
129         install OpenSSL 
130         </para></step>
132         <step><para>
133         generate certificate and private key
135 <screen>
136 &rootprompt;<userinput>/usr/bin/openssl req -new -x509 -days 365 -nodes -config \
137         /usr/share/doc/packages/stunnel/stunnel.cnf \
138         -out /etc/stunnel/stunnel.pem -keyout /etc/stunnel/stunnel.pem</userinput>
139 </screen></para></step>
141         <step><para>
142         remove swat-entry from [x]inetd 
143         </para></step>
145         <step><para>
146         start stunnel
148 <screen>
149 &rootprompt;<userinput>stunnel -p /etc/stunnel/stunnel.pem -d 901 \
150          -l /usr/local/samba/bin/swat swat </userinput>
151 </screen></para></step>
152 </procedure>
154 <para>
155 afterwords simply contact to swat by using the URL <ulink noescape="1" url="https://myhost:901">https://myhost:901</ulink>, accept the certificate
156 and the SSL connection is up.
157 </para>
159 </sect2>
161 <sect2>
162 <title>The SWAT Home Page</title>
164 <para>
165 The SWAT title page provides access to the latest Samba documentation. The manual page for
166 each samba component is accessible from this page as are the Samba-HOWTO-Collection (this 
167 document) as well as the O'Reilly book "Using Samba".
168 </para>
170 <para>
171 Administrators who wish to validate their samba configuration may obtain useful information
172 from the man pages for the diagnostic utilities. These are available from the SWAT home page
173 also. One diagnostic tool that is NOT mentioned on this page, but that is particularly
174 useful is <ulink url="http://www.ethereal.com/"><command>ethereal</command></ulink>.
175 </para>
177 <warning><para>
178 SWAT can be configured to run in <emphasis>demo</emphasis> mode. This is NOT recommended
179 as it runs SWAT without authentication and with full administrative ability. ie: Allows
180 changes to smb.conf as well as general operation with root privileges. The option that
181 creates this ability is the <option>-a</option> flag to swat. <emphasis>Do not use this in any 
182 production environment.</emphasis>
183 </para></warning>
185 </sect2>
187 <sect2>
188 <title>Global Settings</title>
190 <para>
191 The Globals button will expose a page that allows configuration of the global parameters
192 in smb.conf. There are three levels of exposure of the parameters:
193 </para>
195 <itemizedlist>
196         <listitem><para>
197         <emphasis>Basic</emphasis> - exposes common configuration options.
198         </para></listitem>
200         <listitem><para>
201         <emphasis>Advanced</emphasis> - exposes  configuration options needed in more 
202         complex environments.
203         </para></listitem>
205         <listitem><para>
206         <emphasis>Developer</emphasis> - exposes configuration options that only the brave
207         will want to tamper with.
208         </para></listitem>
209 </itemizedlist>
211 <para>
212 To switch to other than <emphasis>Basic</emphasis> editing ability click on either the
213 <emphasis>Advanced</emphasis> or the <emphasis>Developer</emphasis> button. You may also
214 do this by clicking on the radio button, then click the <guibutton>Commit Changes</guibutton> button.
215 </para>
217 <para>
218 After making any changes to configuration parameters make sure that you click on the 
219 <guibutton>Commit Changes</guibutton> button before moving to another area otherwise
220 your changes will be immediately lost.
221 </para>
223 <note><para>
224 SWAT has context sensitive help. To find out what each parameter is for simply click the
225 <guibutton>Help</guibutton> link to the left of the configuration parameter.
226 </para></note>
228 </sect2>
230 <sect2>
231 <title>Share Settings</title>
233 <para>
234 To affect a currently configured share, simply click on the pull down button between the
235 <guibutton>Choose Share</guibutton> and the <guibutton>Delete Share</guibutton> buttons,
236 select the share you wish to operate on, then to edit the settings click on the
237 <guibutton>Choose Share</guibutton> button, to delete the share simply press the
238 <guibutton>Delete Share</guibutton> button.
239 </para>
241 <para>
242 To create a new share, next to the button labelled <guibutton>Create Share</guibutton> enter
243 into the text field the name of the share to be created, then click on the 
244 <guibutton>Create Share</guibutton> button.
245 </para>
247 </sect2>
249 <sect2>
250 <title>Printers Settings</title>
252 <para>
253 To affect a currently configured printer, simply click on the pull down button between the
254 <guibutton>Choose Printer</guibutton> and the <guibutton>Delete Printer</guibutton> buttons,
255 select the printer you wish to operate on, then to edit the settings click on the
256 <guibutton>Choose Printer</guibutton> button, to delete the share simply press the
257 <guibutton>Delete Printer</guibutton> button.
258 </para>
260 <para>
261 To create a new printer, next to the button labelled <guibutton>Create Printer</guibutton> enter
262 into the text field the name of the share to be created, then click on the 
263 <guibutton>Create Printer</guibutton> button.
264 </para>
266 </sect2>
268 <sect2>
269 <title>The SWAT Wizard</title>
271 <para>
272 The purpose if the SWAT Wizard is to help the Microsoft knowledgeable network administrator
273 to configure Samba with a minimum of effort.
274 </para>
276 <para>
277 The Wizard page provides a tool for rewriting the smb.conf file in fully optimised format.
278 This will also happen if you press the commit button. The two differ in the the rewrite button
279 ignores any changes that may have been made, while the Commit button causes all changes to be
280 affected.
281 </para>
283 <para>
284 The <guibutton>Edit</guibutton> button permits the editing (setting) of the minimal set of
285 options that may be necessary to create a working Samba server.
286 </para>
288 <para>
289 Finally, there are a limited set of options that will determine what type of server Samba
290 will be configured for, whether it will be a WINS server, participate as a WINS client, or
291 operate with no WINS support. By clicking on one button you can elect to expose (or not) user
292 home directories.
293 </para>
295 </sect2>
297 <sect2>
298 <title>The Status Page</title>
300 <para>
301 The status page serves a limited purpose. Firstly, it allows control of the samba daemons.
302 The key daemons that create the samba server environment are: &smbd;, &nmbd;, &winbindd;.
303 </para>
305 <para>
306 The daemons may be controlled individually or as a total group. Additionally, you may set
307 an automatic screen refresh timing. As MS Windows clients interact with Samba new smbd processes
308 will be continually spawned. The auto-refresh facility will allow you to track the changing
309 conditions with minimal effort.
310 </para>
312 <para>
313 Lastly, the Status page may be used to terminate specific smbd client connections in order to
314 free files that may be locked.
315 </para>
317 </sect2>
319 <sect2>
320 <title>The View Page</title>
322 <para>
323 This page allows the administrator to view the optimised &smb.conf; file and, if you are
324 particularly masochistic, will permit you also to see all possible global configuration
325 parameters and their settings.
326 </para>
328 </sect2>
330 <sect2>
331 <title>The Password Change Page</title>
333 <para>
334 The Password Change page is a popular tool. This tool allows the creation, deletion, deactivation
335 and reactivation of MS Windows networking users on the local machine. Alternatively, you can use
336 this tool to change a local password for a user account.
337 </para>
339 <para>
340 When logged in as a non-root account the user will have to provide the old password as well as
341 the new password (twice). When logged in as <emphasis>root</emphasis> only the new password is
342 required.
343 </para>
345 <para>
346 One popular use for this tool is to change user passwords across a range of remote MS Windows
347 servers.
348 </para>
350 </sect2>
351 </sect1>
352 </chapter>