source: postlfs/security/stunnel.xml@ ff769b8c

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 ff769b8c was ff769b8c, checked in by Manuel Canales Esparcia <manuel@…>, 19 years ago

Updated the XML sources to use DocBook XML DTD-4.4.

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

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