source: postlfs/security/stunnel.xml@ 3d37094

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 7.10 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 3d37094 was 3d37094, checked in by Fernando de Oliveira <fernando@…>, 10 years ago

gparted-0.19.0
dbus-1.8.4
stunnel-5.02

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

  • Property mode set to 100644
File size: 10.9 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6
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 "bb48b1c18cfc0a42708ef996b1a26926">
10 <!ENTITY stunnel-size "580 KB">
11 <!ENTITY stunnel-buildsize "5.7 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 </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
41 &lfs75_checked;
42
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
65 <bridgehead renderas="sect3">stunnel Dependencies</bridgehead>
66
67 <bridgehead renderas="sect4">Required</bridgehead>
68 <para role="required">
69 <xref linkend="openssl"/>
70 </para>
71
72 <bridgehead renderas="sect4">Optional</bridgehead>
73 <para role="optional">
74 <ulink url="ftp://ftp.porcupine.org/pub/security/">tcpwrappers</ulink>
75 </para>
76
77 <para condition="html" role="usernotes">User Notes:
78 <ulink url="&blfs-wiki;/stunnel"/></para>
79
80 </sect2>
81
82 <sect2 role="installation">
83 <title>Installation of stunnel</title>
84
85 <para>The <command>stunnel</command> daemon will be run in a
86 <command>chroot</command> jail by an unprivileged user. Create the
87 new user and group using the following commands as the
88 <systemitem class="username">root</systemitem> user:</para>
89
90<screen role="root"><userinput>groupadd -g 51 stunnel &amp;&amp;
91useradd -c "stunnel Daemon" -d /var/lib/stunnel \
92 -g stunnel -s /bin/false -u 51 stunnel</userinput></screen>
93
94 <note>
95 <para>A signed SSL Certificate and a Private Key is necessary to run the
96 <command>stunnel</command> daemon. Further below, after
97 <command>make ... install</command>, we include instructions to generate
98 them. However, if you own, or have already created a signed SSL
99 Certificate you wish to use, copy it to
100 <filename>/etc/stunnel/stunnel.pem</filename> before starting the build
101 (ensure only <systemitem class="username">root</systemitem> has read and
102 write access). The <filename class="extension">.pem</filename> file must
103 be formatted as shown below:</para>
104
105<screen><literal>-----BEGIN PRIVATE KEY-----
106<replaceable>&lt;many encrypted lines of private key&gt;</replaceable>
107-----END PRIVATE KEY-----
108-----BEGIN CERTIFICATE-----
109<replaceable>&lt;many encrypted lines of certificate&gt;</replaceable>
110-----END CERTIFICATE-----
111-----BEGIN DH PARAMETERS-----
112<replaceable>&lt;encrypted lines of dh parms&gt;</replaceable>
113-----END DH PARAMETERS-----</literal></screen>
114 </note>
115
116 <para>Install <application>stunnel</application> by running the following
117 commands:</para>
118
119<screen><userinput>./configure --prefix=/usr \
120 --sysconfdir=/etc \
121 --localstatedir=/var &amp;&amp;
122make</userinput></screen>
123
124 <para>This package does not come with a test suite.</para>
125
126 <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
127
128<screen role="root"><userinput>make docdir=/usr/share/doc/stunnel-&stunnel-version; install</userinput></screen>
129
130 <para>To create the <filename>stunnel.pem</filename> in the
131 <filename class="directory">/etc/stunnel</filename> directory,
132 you need to create one. The following command prompts you
133 for the necessary information. Ensure you reply to the</para>
134
135<screen><prompt>Common Name (FQDN of your server) [localhost]:</prompt></screen>
136
137 <para>prompt with the name or IP address you will be using
138 to access the service(s).</para>
139
140 <para>To generate a certificate, as the
141 <systemitem class="username">root</systemitem> user, run:</para>
142
143<screen role="root"><userinput>make cert</userinput></screen>
144
145 </sect2>
146
147 <sect2 role="commands">
148 <title>Command Explanations</title>
149
150 <para><command>make docdir=... install</command>: This command installs the
151 package, changes the documentation installation directory to standard
152 naming conventions.</para>
153
154 </sect2>
155
156 <sect2 role="configuration">
157 <title>Configuring stunnel</title>
158
159 <sect3 id="stunnel-config">
160 <title>Config Files</title>
161
162 <para><filename>/etc/stunnel/stunnel.conf</filename></para>
163
164 <indexterm zone="stunnel stunnel-config">
165 <primary sortas="e-etc-stunnel-stunnel.conf">/etc/stunnel/stunnel.conf</primary>
166 </indexterm>
167
168 </sect3>
169
170 <sect3>
171 <title>Configuration Information</title>
172
173 <para>As the <systemitem class="username">root</systemitem> user,
174 create the directory used for the
175 <filename class="extension">.pid</filename> file that is created
176 when the <application>stunnel</application> daemon starts:</para>
177
178<screen role="root"><userinput>install -v -m750 -o stunnel -g stunnel -d /var/lib/stunnel/run &amp;&amp;
179chown stunnel:stunnel /var/lib/stunnel</userinput></screen>
180
181 <para>Next, create a basic <filename>/etc/stunnel/stunnel.conf</filename>
182 configuration file using the following commands as the
183 <systemitem class="username">root</systemitem> user:</para>
184
185<screen role="root"><userinput>cat &gt;/etc/stunnel/stunnel.conf &lt;&lt; "EOF" &amp;&amp;
186<literal>; File: /etc/stunnel/stunnel.conf
187
188; Note: The pid and output locations are relative to the chroot location.
189
190pid = /run/stunnel.pid
191chroot = /var/lib/stunnel
192client = no
193setuid = stunnel
194setgid = stunnel
195cert = /etc/stunnel/stunnel.pem
196
197;debug = 7
198;output = stunnel.log
199
200;[https]
201;accept = 443
202;connect = 80
203;; "TIMEOUTclose = 0" is a workaround for a design flaw in Microsoft SSL
204;; Microsoft implementations do not use SSL close-notify alert and thus
205;; they are vulnerable to truncation attacks
206;TIMEOUTclose = 0</literal>
207
208EOF
209chmod -v 644 /etc/stunnel/stunnel.conf</userinput></screen>
210
211 <para>Finally, you need to add the service(s) you wish to encrypt to the
212 configuration file. The format is as follows:</para>
213
214<screen><literal>[<replaceable>&lt;service&gt;</replaceable>]
215accept = <replaceable>&lt;hostname:portnumber&gt;</replaceable>
216connect = <replaceable>&lt;hostname:portnumber&gt;</replaceable></literal></screen>
217
218 <para>If you use <application>stunnel</application> to encrypt a daemon
219 started from <command>[x]inetd</command>, you may need to disable that
220 daemon in the <filename>/etc/[x]inetd.conf</filename> file and enable a
221 corresponding <replaceable>&lt;service&gt;</replaceable>_stunnel service. You
222 may have to add an appropriate entry in <filename>/etc/services</filename>
223 as well.</para>
224
225 <para>For a full explanation of the commands and syntax used in the
226 configuration file, run <command>man stunnel</command>.</para>
227
228 </sect3>
229
230 <sect3 id="stunnel-init">
231 <title>Boot Script</title>
232
233 <para>To automatically start the <command>stunnel</command> daemon
234 when the system is rebooted, install the
235 <filename>/etc/rc.d/init.d/stunnel</filename> bootscript from the
236 <xref linkend="bootscripts"/> package.</para>
237
238 <indexterm zone="stunnel stunnel-init">
239 <primary sortas="f-stunnel">stunnel</primary>
240 </indexterm>
241
242<screen role="root"><userinput>make install-stunnel</userinput></screen>
243
244 </sect3>
245
246 </sect2>
247
248 <sect2 role="content">
249 <title>Contents</title>
250
251 <segmentedlist>
252 <segtitle>Installed Programs</segtitle>
253 <segtitle>Installed Library</segtitle>
254 <segtitle>Installed Directories</segtitle>
255
256 <seglistitem>
257 <seg>stunnel and stunnel3</seg>
258 <seg>libstunnel.so</seg>
259 <seg>/etc/stunnel,
260 /usr/lib/stunnel,
261 /usr/share/doc/stunnel-&stunnel-version;, and
262 /var/lib/stunnel</seg>
263 </seglistitem>
264 </segmentedlist>
265
266 <variablelist>
267 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
268 <?dbfo list-presentation="list"?>
269 <?dbhtml list-presentation="table"?>
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
276 (<command>{x}inetd</command>-startable) or remote servers.</para>
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>
309
310</sect1>
Note: See TracBrowser for help on using the repository browser.