1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
|
---|
3 | "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
|
---|
4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
5 | %general-entities;
|
---|
6 |
|
---|
7 | <!ENTITY stunnel-download-http "http://www.stunnel.org/download/stunnel/src/stunnel-&stunnel-version;.tar.gz">
|
---|
8 | <!ENTITY stunnel-download-ftp "ftp://stunnel.mirt.net/stunnel/stunnel-&stunnel-version;.tar.gz">
|
---|
9 | <!ENTITY stunnel-md5sum "2c00153ad099a5f9c5609e8d1dbbe470">
|
---|
10 | <!ENTITY stunnel-size "497 KB">
|
---|
11 | <!ENTITY stunnel-buildsize "4.2 MB">
|
---|
12 | <!ENTITY stunnel-time "0.1 SBU">
|
---|
13 | ]>
|
---|
14 |
|
---|
15 | <sect1 id="stunnel" xreflabel="Stunnel-&stunnel-version;">
|
---|
16 | <?dbhtml filename="stunnel.html"?>
|
---|
17 |
|
---|
18 | <sect1info>
|
---|
19 | <othername>$LastChangedBy$</othername>
|
---|
20 | <date>$Date$</date>
|
---|
21 | <keywordset>
|
---|
22 | <keyword role="package">stunnel-&stunnel-version;.tar</keyword>
|
---|
23 | <keyword role="ftpdir">stunnel</keyword>
|
---|
24 | </keywordset>
|
---|
25 | </sect1info>
|
---|
26 |
|
---|
27 | <title>Stunnel-&stunnel-version;</title>
|
---|
28 |
|
---|
29 | <indexterm zone="stunnel">
|
---|
30 | <primary sortas="a-Stunnel">Stunnel</primary>
|
---|
31 | </indexterm>
|
---|
32 |
|
---|
33 | <sect2 role="package">
|
---|
34 | <title>Introduction to Stunnel</title>
|
---|
35 |
|
---|
36 | <para>The <application>Stunnel</application> package contains a program
|
---|
37 | that allows you to encrypt arbitrary TCP connections inside SSL (Secure
|
---|
38 | Sockets Layer) so you can easily communicate with clients over secure
|
---|
39 | channels. <application>Stunnel</application> can be used to add SSL
|
---|
40 | functionality to commonly used <application>Inetd</application> daemons
|
---|
41 | like POP-2, POP-3, and IMAP servers, to standalone daemons like NNTP,
|
---|
42 | SMTP and HTTP, and in tunneling PPP over network sockets without changes
|
---|
43 | to the server package source code.</para>
|
---|
44 |
|
---|
45 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
46 | <itemizedlist spacing="compact">
|
---|
47 | <listitem>
|
---|
48 | <para>Download (HTTP): <ulink url="&stunnel-download-http;"/></para>
|
---|
49 | </listitem>
|
---|
50 | <listitem>
|
---|
51 | <para>Download (FTP): <ulink url="&stunnel-download-ftp;"/></para>
|
---|
52 | </listitem>
|
---|
53 | <listitem>
|
---|
54 | <para>Download MD5 sum: &stunnel-md5sum;</para>
|
---|
55 | </listitem>
|
---|
56 | <listitem>
|
---|
57 | <para>Download size: &stunnel-size;</para>
|
---|
58 | </listitem>
|
---|
59 | <listitem>
|
---|
60 | <para>Estimated disk space required: &stunnel-buildsize;</para>
|
---|
61 | </listitem>
|
---|
62 | <listitem>
|
---|
63 | <para>Estimated build time: &stunnel-time;</para>
|
---|
64 | </listitem>
|
---|
65 | </itemizedlist>
|
---|
66 |
|
---|
67 | <bridgehead renderas="sect3">Stunnel Dependencies</bridgehead>
|
---|
68 |
|
---|
69 | <bridgehead renderas="sect4">Required</bridgehead>
|
---|
70 | <para role="required"><xref linkend="openssl"/></para>
|
---|
71 |
|
---|
72 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
73 | <para role="optional"><xref linkend="tcpwrappers"/></para>
|
---|
74 |
|
---|
75 | <para condition="html" role="usernotes">User Notes:
|
---|
76 | <ulink url="&blfs-wiki;/stunnel"/></para>
|
---|
77 |
|
---|
78 | </sect2>
|
---|
79 |
|
---|
80 | <sect2 role="installation">
|
---|
81 | <title>Installation of Stunnel</title>
|
---|
82 |
|
---|
83 | <para>The <command>stunnel</command> daemon will be run in a
|
---|
84 | <command>chroot</command> jail by an unprivileged user. Create the
|
---|
85 | new user, group and <command>chroot</command> home directory structure
|
---|
86 | using the following commands as the
|
---|
87 | <systemitem class="username">root</systemitem> user:</para>
|
---|
88 |
|
---|
89 | <screen role="root"><userinput>groupadd -g 51 stunnel &&
|
---|
90 | useradd -c "Stunnel Daemon" -d /var/lib/stunnel \
|
---|
91 | -g stunnel -s /bin/false -u 51 stunnel &&
|
---|
92 | install -v -m 1770 -o stunnel -g stunnel -d /var/lib/stunnel/run</userinput></screen>
|
---|
93 |
|
---|
94 | <note>
|
---|
95 | <para>A signed SSL Certificate and a Private Key is necessary to run
|
---|
96 | the <command>stunnel</command> daemon. If you own, or have already
|
---|
97 | created a signed SSL Certificate you wish to use, copy it to
|
---|
98 | <filename>/etc/stunnel/stunnel.pem</filename> before starting the build
|
---|
99 | (ensure only <systemitem class='username'>root</systemitem> has read and
|
---|
100 | write access), otherwise you will be
|
---|
101 | prompted to create one during the installation process. The
|
---|
102 | <filename class='extension'>.pem</filename> file must be formatted as
|
---|
103 | shown below:</para>
|
---|
104 |
|
---|
105 | <screen><literal>-----BEGIN RSA PRIVATE KEY-----
|
---|
106 | <replaceable><many encrypted lines of unencrypted key></replaceable>
|
---|
107 | -----END RSA PRIVATE KEY-----
|
---|
108 | -----BEGIN CERTIFICATE-----
|
---|
109 | <replaceable><many encrypted lines of certificate></replaceable>
|
---|
110 | -----END CERTIFICATE-----</literal></screen>
|
---|
111 | </note>
|
---|
112 |
|
---|
113 | <para>Install <application>Stunnel</application> by running the following
|
---|
114 | commands:</para>
|
---|
115 |
|
---|
116 | <screen><userinput>sed -i -e 's|nogroup|stunnel|' \
|
---|
117 | -e 's|$(prefix)/var/lib|$(localstatedir)|' \
|
---|
118 | tools/Makefile.in
|
---|
119 | sed -i 's|doc/stunnel|&-$(VERSION)|' {,doc/,tools/}Makefile.in &&
|
---|
120 |
|
---|
121 | ./configure --prefix=/usr --sysconfdir=/etc \
|
---|
122 | --localstatedir=/var/lib --disable-libwrap &&
|
---|
123 | make</userinput></screen>
|
---|
124 |
|
---|
125 | <para>This package does not come with a test suite.</para>
|
---|
126 |
|
---|
127 | <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
|
---|
128 |
|
---|
129 | <screen role="root"><userinput>make install</userinput></screen>
|
---|
130 |
|
---|
131 | </sect2>
|
---|
132 |
|
---|
133 | <sect2 role="commands">
|
---|
134 | <title>Command Explanations</title>
|
---|
135 |
|
---|
136 | <para><command>sed -i -e '...' -e '...' tools/Makefile.in</command>:
|
---|
137 | This <command>sed</command> command modifies the group and directory
|
---|
138 | used for the <command>chroot</command> jail to conform with the parameters
|
---|
139 | created earlier.</para>
|
---|
140 |
|
---|
141 | <para><command>sed -i '...' {,doc/,tools/}Makefile.in</command>: This
|
---|
142 | <command>sed</command> command modifies the location of the installed
|
---|
143 | docs to a versioned directory.</para>
|
---|
144 |
|
---|
145 | <para><parameter>--sysconfdir=/etc</parameter>: This parameter forces
|
---|
146 | the configuration directory to <filename class='directory'>/etc</filename>
|
---|
147 | instead of <filename class='directory'>/usr/etc</filename>.</para>
|
---|
148 |
|
---|
149 | <para><parameter>--localstatedir=/var/lib</parameter>: This parameter
|
---|
150 | sets the installation to use
|
---|
151 | <filename class='directory'>/var/lib/stunnel</filename> instead of
|
---|
152 | creating and using
|
---|
153 | <filename class='directory'>/usr/var/stunnel</filename>.</para>
|
---|
154 |
|
---|
155 | <para><parameter>--disable-libwrap</parameter>: This parameter is required
|
---|
156 | if you don't have <application>tcpwrappers</application> installed. Remove
|
---|
157 | the parameter if <application>tcpwrappers</application> is installed.</para>
|
---|
158 |
|
---|
159 | <para><command>make install</command>: This command installs the package
|
---|
160 | and, if you did not copy an <filename>stunnel.pem</filename> file to the
|
---|
161 | <filename class='directory'>/etc/stunnel</filename> directory, prompts you
|
---|
162 | for the necessary information to create one. Ensure you reply to the</para>
|
---|
163 |
|
---|
164 | <screen><prompt>Common Name (FQDN of your server) [localhost]:</prompt></screen>
|
---|
165 |
|
---|
166 | <para>prompt with the name or IP address you will be using
|
---|
167 | to access the service(s).</para>
|
---|
168 |
|
---|
169 | </sect2>
|
---|
170 |
|
---|
171 | <sect2 role="configuration">
|
---|
172 | <title>Configuring Stunnel</title>
|
---|
173 |
|
---|
174 | <sect3 id="stunnel-config">
|
---|
175 | <title>Config Files</title>
|
---|
176 |
|
---|
177 | <para><filename>/etc/stunnel/stunnel.conf</filename></para>
|
---|
178 |
|
---|
179 | <indexterm zone="stunnel stunnel-config">
|
---|
180 | <primary sortas="e-etc-stunnel-stunnel.conf">/etc/stunnel/stunnel.conf</primary>
|
---|
181 | </indexterm>
|
---|
182 |
|
---|
183 | </sect3>
|
---|
184 |
|
---|
185 | <sect3>
|
---|
186 | <title>Configuration Information</title>
|
---|
187 |
|
---|
188 | <para>Create a basic <filename>/etc/stunnel/stunnel.conf</filename>
|
---|
189 | configuration file using the following commands:</para>
|
---|
190 |
|
---|
191 | <screen role="root"><userinput>cat >/etc/stunnel/stunnel.conf << "EOF" &&
|
---|
192 | <literal># File: /etc/stunnel/stunnel.conf
|
---|
193 |
|
---|
194 | pid = /run/stunnel.pid
|
---|
195 | chroot = /var/lib/stunnel
|
---|
196 | client = no
|
---|
197 | setuid = stunnel
|
---|
198 | setgid = stunnel</literal>
|
---|
199 |
|
---|
200 | EOF
|
---|
201 | chmod -v 644 /etc/stunnel/stunnel.conf</userinput></screen>
|
---|
202 |
|
---|
203 | <para>Next, you need to add the service(s) you wish to encrypt to the
|
---|
204 | configuration file. The format is as follows:</para>
|
---|
205 |
|
---|
206 | <screen><literal>[<replaceable><service></replaceable>]
|
---|
207 | accept = <replaceable><hostname:portnumber></replaceable>
|
---|
208 | connect = <replaceable><hostname:portnumber></replaceable></literal></screen>
|
---|
209 |
|
---|
210 | <para>If you use <application>Stunnel</application> to encrypt a daemon
|
---|
211 | started from <command>[x]inetd</command>, you may need to disable that
|
---|
212 | daemon in the <filename>/etc/[x]inetd.conf</filename> file and enable a
|
---|
213 | corresponding <replaceable><service></replaceable>_stunnel service. You
|
---|
214 | may have to add an appropriate entry in <filename>/etc/services</filename>
|
---|
215 | as well.</para>
|
---|
216 |
|
---|
217 | <para>For a full explanation of the commands and syntax used in the
|
---|
218 | configuration file, run <command>man stunnel</command>. To see a
|
---|
219 | BLFS example of an actual setup of an <command>stunnel</command> encrypted
|
---|
220 | service, read the <xref linkend="samba3-swat-config"/> in the
|
---|
221 | <application>Samba</application> instructions.</para>
|
---|
222 |
|
---|
223 | </sect3>
|
---|
224 |
|
---|
225 | <sect3 id="stunnel-init">
|
---|
226 | <title>Boot Script</title>
|
---|
227 |
|
---|
228 | <para>To automatically start the <command>stunnel</command> daemon
|
---|
229 | when the system is rebooted, install the
|
---|
230 | <filename>/etc/rc.d/init.d/stunnel</filename> bootscript from the
|
---|
231 | <xref linkend="bootscripts"/> package.</para>
|
---|
232 |
|
---|
233 | <indexterm zone="stunnel stunnel-init">
|
---|
234 | <primary sortas="f-stunnel">stunnel</primary>
|
---|
235 | </indexterm>
|
---|
236 |
|
---|
237 | <screen role="root"><userinput>make install-stunnel</userinput></screen>
|
---|
238 |
|
---|
239 | </sect3>
|
---|
240 |
|
---|
241 | </sect2>
|
---|
242 |
|
---|
243 | <sect2 role="content">
|
---|
244 | <title>Contents</title>
|
---|
245 |
|
---|
246 | <segmentedlist>
|
---|
247 | <segtitle>Installed Programs</segtitle>
|
---|
248 | <segtitle>Installed Library</segtitle>
|
---|
249 | <segtitle>Installed Directories</segtitle>
|
---|
250 |
|
---|
251 | <seglistitem>
|
---|
252 | <seg>stunnel and stunnel3</seg>
|
---|
253 | <seg>libstunnel.so</seg>
|
---|
254 | <seg>/etc/stunnel, /var/lib/stunnel and
|
---|
255 | /usr/share/doc/stunnel-&stunnel-version;</seg>
|
---|
256 | </seglistitem>
|
---|
257 | </segmentedlist>
|
---|
258 |
|
---|
259 | <variablelist>
|
---|
260 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
261 | <?dbfo list-presentation="list"?>
|
---|
262 | <?dbhtml list-presentation="table"?>
|
---|
263 |
|
---|
264 | <varlistentry id="stunnel-prog">
|
---|
265 | <term><command>stunnel</command></term>
|
---|
266 | <listitem>
|
---|
267 | <para> is a program designed to work as an SSL
|
---|
268 | encryption wrapper between remote clients and local
|
---|
269 | (<command>{x}inetd</command>-startable) or remote servers.</para>
|
---|
270 | <indexterm zone="stunnel stunnel-prog">
|
---|
271 | <primary sortas="b-stunnel">stunnel</primary>
|
---|
272 | </indexterm>
|
---|
273 | </listitem>
|
---|
274 | </varlistentry>
|
---|
275 |
|
---|
276 | <varlistentry id="stunnel3">
|
---|
277 | <term><command>stunnel3</command></term>
|
---|
278 | <listitem>
|
---|
279 | <para>is a <application>Perl</application> wrapper script to use
|
---|
280 | <command>stunnel</command> 3.x syntax with <command>stunnel</command>
|
---|
281 | >=4.05.</para>
|
---|
282 | <indexterm zone="stunnel stunnel3">
|
---|
283 | <primary sortas="b-stunnel3">stunnel3</primary>
|
---|
284 | </indexterm>
|
---|
285 | </listitem>
|
---|
286 | </varlistentry>
|
---|
287 |
|
---|
288 | <varlistentry id="libstunnel">
|
---|
289 | <term><filename class='libraryfile'>libstunnel.so</filename></term>
|
---|
290 | <listitem>
|
---|
291 | <para> contains the API functions required by
|
---|
292 | <application>Stunnel</application>.</para>
|
---|
293 | <indexterm zone="stunnel libstunnel">
|
---|
294 | <primary sortas="c-libstunnel">libstunnel.so</primary>
|
---|
295 | </indexterm>
|
---|
296 | </listitem>
|
---|
297 | </varlistentry>
|
---|
298 |
|
---|
299 | </variablelist>
|
---|
300 |
|
---|
301 | </sect2>
|
---|
302 |
|
---|
303 | </sect1>
|
---|