source: postlfs/security/stunnel.xml@ 9084c2eb

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 6.2 6.2.0 6.2.0-rc1 6.2.0-rc2 6.3 6.3-rc1 6.3-rc2 6.3-rc3 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 9084c2eb was 9084c2eb, checked in by Manuel Canales Esparcia <manuel@…>, 18 years ago

Typo fix. Postlfs.

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