source: postlfs/security/stunnel.xml@ 305e60de

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

Added indexing tags to Tripwire; more Chapter 4 clean-up

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

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