source: postlfs/security/stunnel.xml@ a49d0f2d

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

Added --disable-libwrap to the configure command in the Stunnel instructions

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

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