source: postlfs/security/stunnel.xml@ ab70ce0

11.0 11.1 11.2 11.3 12.0 12.1 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts lazarus lxqt plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since ab70ce0 was ab70ce0, checked in by Bruce Dubbs <bdubbs@…>, 3 years ago

Fix stunnel md5sum.

  • Property mode set to 100644
File size: 13.4 KB
RevLine 
[2a7d6c3e]1<?xml version="1.0" encoding="ISO-8859-1"?>
[6732c094]2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
[2a7d6c3e]4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6
[43aa464d]7 <!ENTITY stunnel-download-http " ">
[49ee8357]8 <!-- Following ftp also has older releases -->
9 <!ENTITY stunnel-download-ftp "ftp://ftp.stunnel.org/stunnel/archive/5.x/stunnel-&stunnel-version;.tar.gz">
10 <!-- Following ftp only has later release -->
[a8f943ff]11<!-- "ftp://ftp.stunnel.org/stunnel/stunnel-&stunnel-version;.tar.gz"> -->
[ab70ce0]12 <!ENTITY stunnel-md5sum "947c1e114a217f2cf2adaabc5573788c">
[1c4b4e9]13 <!ENTITY stunnel-size "968 KB">
14 <!ENTITY stunnel-buildsize "8.8 MB">
15 <!ENTITY stunnel-time "0.1 SBU">
[2a7d6c3e]16]>
17
[436c2f7e]18<sect1 id="stunnel" xreflabel="stunnel-&stunnel-version;">
[d3469f0]19 <?dbhtml filename="stunnel.html"?>
20
21 <sect1info>
22 <date>$Date$</date>
23 </sect1info>
24
[436c2f7e]25 <title>stunnel-&stunnel-version;</title>
[d3469f0]26
27 <indexterm zone="stunnel">
[436c2f7e]28 <primary sortas="a-stunnel">stunnel</primary>
[d3469f0]29 </indexterm>
30
31 <sect2 role="package">
[436c2f7e]32 <title>Introduction to stunnel</title>
[d3469f0]33
[47274444]34 <para>
35 The <application>stunnel</application> package contains a program
36 that allows you to encrypt arbitrary TCP connections inside SSL (Secure
37 Sockets Layer) so you can easily communicate with clients over secure
38 channels. <application>stunnel</application> can be used to add SSL
39 functionality to commonly used <application>Inetd</application> daemons
40 such as POP-2, POP-3, and IMAP servers, along with standalone daemons
41 such as NNTP, SMTP, and HTTP. <application>stunnel</application> can
42 also be used to tunnel PPP over network sockets without changes to the
43 server package source code.
44 </para>
[d3469f0]45
[1c4b4e9]46 &lfs101_checked;
[ee792ef]47
[d3469f0]48 <bridgehead renderas="sect3">Package Information</bridgehead>
49 <itemizedlist spacing="compact">
50 <listitem>
[47274444]51 <para>
52 Download (HTTP): <ulink url="&stunnel-download-http;"/>
53 </para>
[d3469f0]54 </listitem>
55 <listitem>
[47274444]56 <para>
57 Download (FTP): <ulink url="&stunnel-download-ftp;"/>
58 </para>
[d3469f0]59 </listitem>
60 <listitem>
[47274444]61 <para>
62 Download MD5 sum: &stunnel-md5sum;
63 </para>
[d3469f0]64 </listitem>
65 <listitem>
[47274444]66 <para>
67 Download size: &stunnel-size;
68 </para>
[d3469f0]69 </listitem>
70 <listitem>
[47274444]71 <para>
72 Estimated disk space required: &stunnel-buildsize;
73 </para>
[d3469f0]74 </listitem>
75 <listitem>
[47274444]76 <para>
77 Estimated build time: &stunnel-time;
78 </para>
[d3469f0]79 </listitem>
80 </itemizedlist>
81
[436c2f7e]82 <bridgehead renderas="sect3">stunnel Dependencies</bridgehead>
[658b42d8]83
[372898b]84 <bridgehead renderas="sect4">Optional</bridgehead>
85 <para role="optional">
[47274444]86 <ulink url="http://netcat.sourceforge.net/">netcat</ulink>
87 (required for tests),
88 <ulink url="ftp://ftp.porcupine.org/pub/security/">tcpwrappers</ulink>,
89 and
[15e49d1]90 <ulink url="https://dist.torproject.org/">TOR</ulink>
[372898b]91 </para>
[d3469f0]92
[3597eb6]93 <para condition="html" role="usernotes">User Notes:
94 <ulink url="&blfs-wiki;/stunnel"/></para>
95
[d3469f0]96 </sect2>
97
98 <sect2 role="installation">
[436c2f7e]99 <title>Installation of stunnel</title>
[d3469f0]100
[47274444]101 <para>
102 The <command>stunnel</command> daemon will be run in a
103 <command>chroot</command> jail by an unprivileged user. Create the
104 new user and group using the following commands as the
105 <systemitem class="username">root</systemitem> user:
106 </para>
[d3469f0]107
[b785ab29]108<screen role="root"><userinput>groupadd -g 51 stunnel &amp;&amp;
[436c2f7e]109useradd -c "stunnel Daemon" -d /var/lib/stunnel \
[1ae11c9]110 -g stunnel -s /bin/false -u 51 stunnel</userinput></screen>
[d3469f0]111
112 <note>
[47274444]113 <para>
114 A signed SSL Certificate and a Private Key is necessary to run the
115 <command>stunnel</command> daemon. After the package is installed,
116 there are instructions to generate them. However, if you own or have
117 already created a signed SSL Certificate you wish to use, copy it to
118 <filename>/etc/stunnel/stunnel.pem</filename> before starting the
119 build (ensure only <systemitem class="username">root</systemitem> has
120 read and write access). The <filename class="extension">.pem</filename>
121 file must be formatted as shown below:
122 </para>
[d3469f0]123
[30ca77d2]124<screen><literal>-----BEGIN PRIVATE KEY-----
125<replaceable>&lt;many encrypted lines of private key&gt;</replaceable>
126-----END PRIVATE KEY-----
[2a7d6c3e]127-----BEGIN CERTIFICATE-----
[3597eb6]128<replaceable>&lt;many encrypted lines of certificate&gt;</replaceable>
[30ca77d2]129-----END CERTIFICATE-----
130-----BEGIN DH PARAMETERS-----
131<replaceable>&lt;encrypted lines of dh parms&gt;</replaceable>
132-----END DH PARAMETERS-----</literal></screen>
[47274444]133
[d3469f0]134 </note>
[2a7d6c3e]135
[47274444]136 <para>
137 Install <application>stunnel</application> by running the following
138 commands:
139 </para>
[4a496c3]140
[0f870c5]141<!-- Not needed, we're 10+ versions ahead of this now
[4efb652]142 <note>
[47274444]143 <para>
144 For some systems with <application>binutils</application>
145 versions prior to 2.25, <command>configure</command> may fail. If
146 necessary, fix it either with:
147 </para>
[4d5c31d]148
149<screen><userinput>sed -i '/LDFLAGS.*static_flag/ s/^/#/' configure</userinput></screen>
150
[47274444]151 <para>
152 or, if <xref linkend="llvm"/> with Clang is installed, you can
153 replace <command>./configure ...</command> with <command>CC=clang
154 ./configure ...</command> in the first command below.
155 </para>
[4efb652]156 </note>
[0f870c5]157-->
[d3469f0]158
[3c7bd00]159<screen revision="sysv"><userinput>./configure --prefix=/usr \
[06b565e]160 --sysconfdir=/etc \
161 --localstatedir=/var \
162 --disable-systemd &amp;&amp;
[d3469f0]163make</userinput></screen>
164
[3c7bd00]165<screen revision="systemd"><userinput>./configure --prefix=/usr \
166 --sysconfdir=/etc \
167 --localstatedir=/var &amp;&amp;
168make</userinput></screen>
169
[47274444]170 <para>
171 If you have installed the optional netcat application, the
172 regression tests can be run with <command>make check</command>.
173 </para>
[50d61ed]174
[47274444]175 <para>
176 Now, as the <systemitem class="username">root</systemitem> user:
177 </para>
[305e60de]178
[1ae11c9]179<screen role="root"><userinput>make docdir=/usr/share/doc/stunnel-&stunnel-version; install</userinput></screen>
[305e60de]180
[f586237]181 <para revision="systemd">
182 Install the included systemd unit by running the following command as the
183 <systemitem class="username">root</systemitem> user:
184 </para>
185
186<screen role="root" revision="systemd"><userinput>install -v -m644 tools/stunnel.service /lib/systemd/system</userinput></screen>
187
[47274444]188 <para>
189 If you do not already have a signed SSL Certificate and Private Key,
190 create the <filename>stunnel.pem</filename> file in the
191 <filename class="directory">/etc/stunnel</filename> directory using the
192 command below. You will be prompted to enter the necessary
193 information. Ensure you reply to the
194 </para>
[4efb652]195
[372898b]196<screen><prompt>Common Name (FQDN of your server) [localhost]:</prompt></screen>
197
[47274444]198 <para>
199 prompt with the name or IP address you will be using
200 to access the service(s).
201 </para>
[372898b]202
[47274444]203 <para>
204 To generate a certificate, as the
205 <systemitem class="username">root</systemitem> user, issue:
206 </para>
[372898b]207
208<screen role="root"><userinput>make cert</userinput></screen>
209
[d3469f0]210 </sect2>
[2a7d6c3e]211
[d3469f0]212 <sect2 role="commands">
213 <title>Command Explanations</title>
[2a7d6c3e]214
[47274444]215 <para revision="sysv">
216 <parameter>--disable-systemd</parameter>: This switch disables systemd
217 socket activation support which is not available in BLFS.
218 </para>
[06b565e]219
[47274444]220 <para>
221 <command>make docdir=... install</command>: This command installs the
222 package and changes the documentation installation directory to standard
223 naming conventions.
224 </para>
[2a7d6c3e]225
[d3469f0]226 </sect2>
[2a7d6c3e]227
[d3469f0]228 <sect2 role="configuration">
[436c2f7e]229 <title>Configuring stunnel</title>
[2a7d6c3e]230
[d3469f0]231 <sect3 id="stunnel-config">
232 <title>Config Files</title>
[2a7d6c3e]233
[47274444]234 <para>
235 <filename>/etc/stunnel/stunnel.conf</filename>
236 </para>
[2a7d6c3e]237
[d3469f0]238 <indexterm zone="stunnel stunnel-config">
239 <primary sortas="e-etc-stunnel-stunnel.conf">/etc/stunnel/stunnel.conf</primary>
240 </indexterm>
[2a7d6c3e]241
[d3469f0]242 </sect3>
[2a7d6c3e]243
[d3469f0]244 <sect3>
245 <title>Configuration Information</title>
246
[47274444]247 <para>
248 As the <systemitem class="username">root</systemitem> user,
249 create the directory used for the
250 <filename class="extension">.pid</filename> file created
251 when the <application>stunnel</application> daemon starts:
252 </para>
[1ae11c9]253
[8ba08b56]254<screen role="root"><userinput>install -v -m750 -o stunnel -g stunnel -d /var/lib/stunnel/run &amp;&amp;
255chown stunnel:stunnel /var/lib/stunnel</userinput></screen>
[1ae11c9]256
[47274444]257 <para>
258 Next, create a basic <filename>/etc/stunnel/stunnel.conf</filename>
259 configuration file using the following commands as the
260 <systemitem class="username">root</systemitem> user:
261 </para>
[d3469f0]262
[1c4b4e9]263<screen role="root"><userinput>cat &gt; /etc/stunnel/stunnel.conf &lt;&lt; "EOF"
[1ae11c9]264<literal>; File: /etc/stunnel/stunnel.conf
[2a7d6c3e]265
[372898b]266; Note: The pid and output locations are relative to the chroot location.
267
[1ae11c9]268pid = /run/stunnel.pid
[2a7d6c3e]269chroot = /var/lib/stunnel
270client = no
271setuid = stunnel
[30ca77d2]272setgid = stunnel
[372898b]273cert = /etc/stunnel/stunnel.pem
274
275;debug = 7
276;output = stunnel.log
277
278;[https]
279;accept = 443
280;connect = 80
281;; "TIMEOUTclose = 0" is a workaround for a design flaw in Microsoft SSL
282;; Microsoft implementations do not use SSL close-notify alert and thus
283;; they are vulnerable to truncation attacks
284;TIMEOUTclose = 0</literal>
[2a7d6c3e]285
[bfdd32ae]286EOF</userinput></screen>
[2a7d6c3e]287
[47274444]288 <para>
289 Finally, add the service(s) you wish to encrypt to the
290 configuration file. The format is as follows:
291 </para>
[2a7d6c3e]292
[3597eb6]293<screen><literal>[<replaceable>&lt;service&gt;</replaceable>]
294accept = <replaceable>&lt;hostname:portnumber&gt;</replaceable>
295connect = <replaceable>&lt;hostname:portnumber&gt;</replaceable></literal></screen>
[d3469f0]296
[47274444]297 <para>
298 If you use <application>stunnel</application> to encrypt a daemon
299 started from <command>[x]inetd</command>, you may need to disable that
300 daemon in the <filename>/etc/[x]inetd.conf</filename> file and enable a
301 corresponding <replaceable>&lt;service&gt;</replaceable>_stunnel
302 service. You may have to add an appropriate entry in
303 <filename>/etc/services</filename> as well.
304 </para>
[d3469f0]305
[47274444]306 <para>
307 For a full explanation of the commands and syntax used in the
308 configuration file, issue <command>man stunnel</command>.
309 </para>
[d3469f0]310
311 </sect3>
312
313 <sect3 id="stunnel-init">
[f586237]314 <title><phrase revision="sysv">Boot Script</phrase>
315 <phrase revision="systemd">Systemd Unit</phrase></title>
[d3469f0]316
[47274444]317 <para revision="sysv">
318 To automatically start the <command>stunnel</command> daemon when the
319 system is booted, install the
320 <filename>/etc/rc.d/init.d/stunnel</filename> bootscript from the
321 <xref linkend="bootscripts"/> package.
322 </para>
[f586237]323
[47274444]324 <para revision="systemd">
325 To start the <command>stunnel</command>
326 daemon at boot, enable the previously installed
327 <application>systemd</application> unit by running the following
328 command as the <systemitem class="username">root</systemitem> user:
329 </para>
[d3469f0]330
331 <indexterm zone="stunnel stunnel-init">
332 <primary sortas="f-stunnel">stunnel</primary>
333 </indexterm>
334
[f586237]335<screen role="root" revision="sysv"><userinput>make install-stunnel</userinput></screen>
336
337<screen role="root" revision="systemd"><userinput>systemctl enable stunnel</userinput></screen>
[d3469f0]338
339 </sect3>
340
341 </sect2>
342
343 <sect2 role="content">
344 <title>Contents</title>
345
346 <segmentedlist>
347 <segtitle>Installed Programs</segtitle>
348 <segtitle>Installed Library</segtitle>
349 <segtitle>Installed Directories</segtitle>
350
351 <seglistitem>
[49ee8357]352 <seg>
353 stunnel and stunnel3
354 </seg>
355 <seg>
356 libstunnel.so
357 </seg>
358 <seg>
[96598583]359 /{etc,usr/lib,var/lib}/stunnel and
[49ee8357]360 /usr/share/doc/stunnel-&stunnel-version;
361 </seg>
[d3469f0]362 </seglistitem>
363 </segmentedlist>
364
365 <variablelist>
366 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
367 <?dbfo list-presentation="list"?>
[869b15ae]368 <?dbhtml list-presentation="table"?>
[d3469f0]369
370 <varlistentry id="stunnel-prog">
371 <term><command>stunnel</command></term>
372 <listitem>
[47274444]373 <para>
374 is a program designed to work as an SSL
375 encryption wrapper between remote clients and local
[4c24eb0a]376 (<command>{x}inetd</command>-startable) or remote servers
[47274444]377 </para>
[d3469f0]378 <indexterm zone="stunnel stunnel-prog">
379 <primary sortas="b-stunnel">stunnel</primary>
380 </indexterm>
381 </listitem>
382 </varlistentry>
383
384 <varlistentry id="stunnel3">
385 <term><command>stunnel3</command></term>
386 <listitem>
[47274444]387 <para>
388 is a <application>Perl</application> wrapper script to use
389 <command>stunnel</command> 3.x syntax with
[4c24eb0a]390 <command>stunnel</command> 4.05 or later
[47274444]391 </para>
[d3469f0]392 <indexterm zone="stunnel stunnel3">
393 <primary sortas="b-stunnel3">stunnel3</primary>
394 </indexterm>
395 </listitem>
396 </varlistentry>
397
398 <varlistentry id="libstunnel">
[4c24eb0a]399 <term><filename class="libraryfile">libstunnel.so</filename></term>
[d3469f0]400 <listitem>
[47274444]401 <para>
402 contains the API functions required by
[4c24eb0a]403 <application>stunnel</application>
[47274444]404 </para>
[d3469f0]405 <indexterm zone="stunnel libstunnel">
406 <primary sortas="c-libstunnel">libstunnel.so</primary>
407 </indexterm>
408 </listitem>
409 </varlistentry>
410
411 </variablelist>
412
413 </sect2>
[2a7d6c3e]414
415</sect1>
Note: See TracBrowser for help on using the repository browser.