4a2eeec3d513b33dd5f89e2be430ab2d8e24a2ea
[samba.git] / docs / htmldocs / swat.8.html
1
2
3  
4
5
6 <html><head><title>swat</title>
7
8 <link rev="made" href="mailto:samba-bugs@samba.anu.edu.au">
9 </head>
10 <body>
11
12 <hr>
13
14 <h1>swat</h1>
15 <h2>Samba</h2>
16 <h2>23 Oct 1998</h2>
17
18     
19
20     
21 <p><br><a name="NAME"></a>
22 <h2>NAME</h2>
23     swat - swat - Samba Web Administration Tool
24 <p><br><a name="SYNOPSIS"></a>
25 <h2>SYNOPSIS</h2>
26     
27 <p><br><strong>swat</strong> [<a href="swat.8.html#minuss">-s smb config file</a>] [<a href="swat.8.html#minusa">-a</a>]
28 <p><br><a name="DESCRIPTION"></a>
29 <h2>DESCRIPTION</h2>
30     
31 <p><br>This program is part of the <strong>Samba</strong> suite.
32 <p><br><strong>swat</strong> allows a Samba administrator to configure the complex
33 <a href="smb.conf.5.html"><strong>smb.conf</strong></a> file via a Web browser. In
34 addition, a swat configuration page has help links to all the
35 configurable options in the <a href="smb.conf.5.html"><strong>smb.conf</strong></a> file
36 allowing an administrator to easily look up the effects of any change.
37 <p><br><strong>swat</strong> can be run as a stand-alone daemon, from <strong>inetd</strong>,
38 or invoked via CGI from a Web server.
39 <p><br><a name="OPTIONS"></a>
40 <h2>OPTIONS</h2>
41     
42 <p><br><ul>
43 <p><br><a name="minuss"></a>
44 <li><strong><strong>-s smb configuration file</strong></strong> The default configuration file path is
45 determined at compile time.
46 <p><br>The file specified contains the configuration details required by the
47 <a href="smbd.8.html"><strong>smbd</strong></a> server. This is the file that <strong>swat</strong> will
48 modify. The information in this file includes server-specific
49 information such as what printcap file to use, as well as descriptions
50 of all the services that the server is to provide. See <a href="smb.conf.5.html">smb.conf
51 (5)</a> for more information.
52 <p><br><a name="minusa"></a>
53 <li><strong><strong>-a</strong></strong> 
54 <p><br>This option is only used if <strong>swat</strong> is running as it's own mini-web
55 server (see the <a href="swat.8.html#INSTALLATION"><strong>INSTALLATION</strong></a> section below).
56 <p><br>This option removes the need for authentication needed to modify the
57 <a href="smb.conf.5.html"><strong>smb.conf</strong></a> file. <em>**THIS IS ONLY MEANT FOR
58 DEMOING SWAT AND MUST NOT BE SET IN NORMAL SYSTEMS**</em> as it would
59 allow <em>*ANYONE*</em> to modify the <a href="smb.conf.5.html"><strong>smb.conf</strong></a>
60 file, thus giving them root access.
61 <p><br></ul>
62 <p><br><a name="INSTALLATION"></a>
63 <h2>INSTALLATION</h2>
64     
65 <p><br>After you compile SWAT you need to run <code>"make install"</code> to install the
66 swat binary and the various help files and images. A default install
67 would put these in:
68 <p><br><pre>
69
70 /usr/local/samba/bin/swat
71 /usr/local/samba/swat/images/*
72 /usr/local/samba/swat/help/*
73
74 </pre>
75
76 <p><br><a name="RUNNINGVIAINETD"></a>
77 <h2>RUNNING VIA INETD</h2>
78     
79 <p><br>You need to edit your <code>/etc/inetd.conf</code> and <code>/etc/services</code> to
80 enable <strong>SWAT</strong> to be launched via inetd. Note that <strong>swat</strong> can also
81 be launched via the cgi-bin mechanisms of a web server (such as
82 apache) and that is described below in the section <a href="swat.8.html#RUNNINGVIACGIBIN"><strong>RUNNING VIA
83 CGI-BIN</strong></a>.
84 <p><br>In <code>/etc/services</code> you need to add a line like this:
85 <p><br><code>swat            901/tcp</code>
86 <p><br>Note for NIS/YP users - you may need to rebuild the NIS service maps
87 rather than alter your local <code>/etc/services</code> file.
88 <p><br>the choice of port number isn't really important except that it should
89 be less than 1024 and not currently used (using a number above 1024
90 presents an obscure security hole depending on the implementation
91 details of your <strong>inetd</strong> daemon).
92 <p><br>In <code>/etc/inetd.conf</code> you should add a line like this:
93 <p><br><code>swat    stream  tcp     nowait.400  root    /usr/local/samba/bin/swat swat</code>
94 <p><br>If you just want to see a demo of how swat works and don't want to be
95 able to actually change any Samba config via swat then you may chose
96 to change <code>"root"</code> to some other user that does not have permission
97 to write to <a href="smb.conf.5.html"><strong>smb.conf</strong></a>.
98 <p><br>One you have edited <code>/etc/services</code> and <code>/etc/inetd.conf</code> you need
99 to send a HUP signal to inetd. To do this use <code>"kill -1 PID"</code> where
100 PID is the process ID of the inetd daemon.
101 <p><br><a name="RUNNINGVIACGIBIN"></a>
102 <h2>RUNNING VIA CGI-BIN</h2>
103     
104 <p><br>To run <strong>swat</strong> via your web servers cgi-bin capability you need to
105 copy the <strong>swat</strong> binary to your cgi-bin directory. Note that you
106 should run <strong>swat</strong> either via <a href="swat.8.html#RUNNINGVIAINETD"><strong>inetd</strong></a> or via
107 cgi-bin but not both.
108 <p><br>Then you need to create a <code>swat/</code> directory in your web servers root
109 directory and copy the <code>images/*</code> and <code>help/*</code> files found in the
110 <code>swat/</code> directory of your Samba source distribution into there so
111 that they are visible via the URL <code>http://your.web.server/swat/</code>
112 <p><br>Next you need to make sure you modify your web servers authentication
113 to require a username/pssword for the URL
114 <code>http://your.web.server/cgi-bin/swat</code>. <em>**Don't forget this
115 step!**</em> If you do forget it then you will be allowing anyone to edit
116 your Samba configuration which would allow them to easily gain root
117 access on your machine.
118 <p><br>After testing the authentication you need to change the ownership and
119 permissions on the <strong>swat</strong> binary. It should be owned by root wth the
120 setuid bit set. It should be ONLY executable by the user that the web
121 server runs as. Make sure you do this carefully!
122 <p><br>for example, the following would be correct if the web server ran as
123 group <code>"nobody"</code>.
124 <p><br><code>-rws--x---    1 root     nobody    </code>
125 <p><br>You must also realise that this means that any user who can run
126 programs as the <code>"nobody"</code> group can run <strong>swat</strong> and modify your
127 Samba config. Be sure to think about this!
128 <p><br><a name="LAUNCHING"></a>
129 <h2>LAUNCHING</h2>
130     
131 <p><br>To launch <strong>swat</strong> just run your favourite web browser and point it at
132 <code>http://localhost:901/</code> or <code>http://localhost/cgi-bin/swat/</code>
133 depending on how you installed it.
134 <p><br>Note that you can attach to <strong>swat</strong> from any IP connected machine but
135 connecting from a remote machine leaves your connection open to
136 password sniffing as passwords will be sent in the clear over the
137 wire.
138 <p><br>If installed via <strong>inetd</strong> then you should be prompted for a
139 username/password when you connect. You will need to provide the
140 username <code>"root"</code> and the correct root password. More sophisticated
141 authentication options are planned for future versions of <strong>swat</strong>.
142 <p><br>If installed via cgi-bin then you should receive whatever
143 authentication request you configured in your web server.
144 <p><br><h2>FILES</h2>
145     
146 <p><br><strong>/etc/inetd.conf</strong>
147 <p><br>If the server is to be run by the inetd meta-daemon, this file must
148 contain suitable startup information for the meta-daemon. See the
149 section <a href="swat.8.html#RUNNINGVIAINETD"><strong>RUNNING VIA INETD</strong></a> above.
150 <p><br><strong>/etc/services</strong>
151 <p><br>If running the server via the meta-daemon inetd, this file must
152 contain a mapping of service name (eg., swat) to service port
153 (eg., 901) and protocol type (eg., tcp). See the section
154 <a href="swat.8.html#RUNNINGVIAINETD"><strong>RUNNING VIA INETD</strong></a> above.
155 <p><br><strong>/usr/local/samba/lib/smb.conf</strong>
156 <p><br>This is the default location of the <em>smb.conf</em> server configuration
157 file that <strong>swat</strong> edits. Other common places that systems install
158 this file are <em>/usr/samba/lib/smb.conf</em> and <em>/etc/smb.conf</em>.
159 <p><br>This file describes all the services the server is to make available
160 to clients. See <strong>smb.conf (5)</strong> for more information.
161 <p><br><a name="WARNINGS"></a>
162 <h2>WARNINGS</h2>
163     
164 <p><br><strong>swat</strong> will rewrite your <a href="smb.conf.5.html"><strong>smb.conf</strong></a> file. It
165 will rearrange the entries and delete all comments,
166 <a href="smb.conf.5.html#include"><strong>"include="</strong></a> and
167 <a href="smb.conf.5.html#copy"><strong>"copy="</strong></a> options. If you have a
168 carefully crafted <a href="smb.conf.5.html"><strong>smb.conf</strong></a> then back it up
169 or don't use <strong>swat</strong>!
170 <p><br><a name="VERSION"></a>
171 <h2>VERSION</h2>
172     
173 <p><br>This man page is correct for version 2.0 of the Samba suite.
174 <p><br><a name="SEEALSO"></a>
175 <h2>SEE ALSO</h2>
176     
177 <p><br><strong>inetd (8)</strong>, <a href="nmbd.8.html"><strong>nmbd (8)</strong></a>,
178 <a href="smb.conf.5.html"><strong>smb.conf (5)</strong></a>.
179 <p><br><a name="AUTHOR"></a>
180 <h2>AUTHOR</h2>
181     
182 <p><br>The original Samba software and related utilities were created by
183 Andrew Tridgell (samba-bugs@samba.anu.edu.au). Samba is now developed
184 by the Samba Team as an Open Source project similar to the way the
185 Linux kernel is developed.
186 <p><br>The original Samba man pages were written by Karl Auer. The man page
187 sources were converted to YODL format (another excellent piece of Open
188 Source software, available at
189 <a href="ftp://ftp.icce.rug.nl/pub/unix/"><strong>ftp://ftp.icce.rug.nl/pub/unix/</strong></a>)
190 and updated for the Samba2.0 release by Jeremy Allison.
191 <a href="mailto:samba-bugs@samba.anu.edu.au"><em>samba-bugs@samba.anu.edu.au</em></a>.
192 <p><br>See <a href="samba.7.html"><strong>samba (7)</strong></a> to find out how to get a full
193 list of contributors and details on how to submit bug reports,
194 comments etc.
195 </body>
196 </html>