source: postlfs/security/stunnel.xml@ b84342d6

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 7.10 7.4 7.5 7.6 7.6-blfs 7.6-systemd 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind gnome kde5-13430 kde5-14269 kde5-14686 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts krejzi/svn lazarus lxqt nosym perl-modules plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition systemd-11177 systemd-13485 trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since b84342d6 was 6c70af9b, checked in by Bruce Dubbs <bdubbs@…>, 12 years ago

updated to stunnel-4.52

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

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