source: postlfs/security/stunnel.xml@ b9d5573a

10.0 10.1 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 b9d5573a was b9d5573a, checked in by Bruce Dubbs <bdubbs@…>, 4 years ago

More tags
Remove libnftnl which was commented out

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@23609 af4574ff-66df-0310-9fd7-8a98e5e911e0

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