source: postlfs/security/stunnel.xml@ 45c41547

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

Chapter 4 patch attachment. Thanks to Armin K.

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

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