source: postlfs/security/stunnel.xml@ ab47e379

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

Updated to Stunnel-4.15

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

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