source: postlfs/security/stunnel.xml@ 423b1d94

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 6.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 423b1d94 was 423b1d94, checked in by Randy McMurchy <randy@…>, 19 years ago

Updated to Stunnel-4.09

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

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