source: postlfs/security/stunnel.xml@ 30ca77d2

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 30ca77d2 was 30ca77d2, checked in by Randy McMurchy <randy@…>, 13 years ago

Updated to Stunnel-4.34

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

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