source: postlfs/security/stunnel.xml@ be2215e

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 8.4 9.0 9.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 be2215e was be2215e, checked in by Bruce Dubbs <bdubbs@…>, 5 years ago

Tag packages in postlfs part

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

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