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