2004-10-28 02:22:58 +08:00
|
|
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
2005-04-04 04:52:42 +08:00
|
|
|
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
|
|
|
|
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
|
2004-10-28 02:22:58 +08:00
|
|
|
<!ENTITY % general-entities SYSTEM "../../general.ent">
|
|
|
|
%general-entities;
|
|
|
|
|
2005-07-20 22:40:00 +08:00
|
|
|
<!ENTITY stunnel-download-http "http://www.stunnel.org/download/stunnel/src/stunnel-&stunnel-version;.tar.gz">
|
2005-04-05 03:09:01 +08:00
|
|
|
<!ENTITY stunnel-download-ftp "ftp://stunnel.mirt.net/stunnel/stunnel-&stunnel-version;.tar.gz">
|
2006-03-31 10:07:53 +08:00
|
|
|
<!ENTITY stunnel-md5sum "2c00153ad099a5f9c5609e8d1dbbe470">
|
|
|
|
<!ENTITY stunnel-size "497 KB">
|
|
|
|
<!ENTITY stunnel-buildsize "4.2 MB">
|
2005-07-21 02:28:37 +08:00
|
|
|
<!ENTITY stunnel-time "0.1 SBU">
|
2004-10-28 02:22:58 +08:00
|
|
|
]>
|
|
|
|
|
2005-01-26 03:21:25 +08:00
|
|
|
<sect1 id="stunnel" xreflabel="Stunnel-&stunnel-version;">
|
2005-05-15 00:30:29 +08:00
|
|
|
<?dbhtml filename="stunnel.html"?>
|
|
|
|
|
|
|
|
<sect1info>
|
|
|
|
<othername>$LastChangedBy$</othername>
|
|
|
|
<date>$Date$</date>
|
2005-12-08 02:47:32 +08:00
|
|
|
<keywordset>
|
|
|
|
<keyword role="package">stunnel-&stunnel-version;.tar</keyword>
|
2005-12-09 04:31:22 +08:00
|
|
|
<keyword role="ftpdir">stunnel</keyword>
|
2005-12-08 02:47:32 +08:00
|
|
|
</keywordset>
|
2005-05-15 00:30:29 +08:00
|
|
|
</sect1info>
|
|
|
|
|
|
|
|
<title>Stunnel-&stunnel-version;</title>
|
|
|
|
|
|
|
|
<indexterm zone="stunnel">
|
|
|
|
<primary sortas="a-Stunnel">Stunnel</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<sect2 role="package">
|
|
|
|
<title>Introduction to Stunnel</title>
|
|
|
|
|
|
|
|
<para>The <application>Stunnel</application> package contains a program
|
|
|
|
that allows you to encrypt arbitrary TCP connections inside SSL (Secure
|
|
|
|
Sockets Layer) so you can easily communicate with clients over secure
|
|
|
|
channels. <application>Stunnel</application> can be used to add SSL
|
|
|
|
functionality to commonly used <application>Inetd</application> daemons
|
|
|
|
like POP-2, POP-3, and IMAP servers, to standalone daemons like NNTP,
|
|
|
|
SMTP and HTTP, and in tunneling PPP over network sockets without changes
|
|
|
|
to the server package source code.</para>
|
|
|
|
|
|
|
|
<bridgehead renderas="sect3">Package Information</bridgehead>
|
|
|
|
<itemizedlist spacing="compact">
|
|
|
|
<listitem>
|
|
|
|
<para>Download (HTTP): <ulink url="&stunnel-download-http;"/></para>
|
|
|
|
</listitem>
|
|
|
|
<listitem>
|
|
|
|
<para>Download (FTP): <ulink url="&stunnel-download-ftp;"/></para>
|
|
|
|
</listitem>
|
|
|
|
<listitem>
|
|
|
|
<para>Download MD5 sum: &stunnel-md5sum;</para>
|
|
|
|
</listitem>
|
|
|
|
<listitem>
|
|
|
|
<para>Download size: &stunnel-size;</para>
|
|
|
|
</listitem>
|
|
|
|
<listitem>
|
|
|
|
<para>Estimated disk space required: &stunnel-buildsize;</para>
|
|
|
|
</listitem>
|
|
|
|
<listitem>
|
|
|
|
<para>Estimated build time: &stunnel-time;</para>
|
|
|
|
</listitem>
|
|
|
|
</itemizedlist>
|
|
|
|
|
|
|
|
<bridgehead renderas="sect3">Stunnel Dependencies</bridgehead>
|
|
|
|
|
|
|
|
<bridgehead renderas="sect4">Required</bridgehead>
|
2005-12-08 02:47:32 +08:00
|
|
|
<para role="required"><xref linkend="openssl"/></para>
|
2005-05-15 00:30:29 +08:00
|
|
|
|
|
|
|
<bridgehead renderas="sect4">Optional</bridgehead>
|
2005-12-08 02:47:32 +08:00
|
|
|
<para role="optional"><xref linkend="tcpwrappers"/></para>
|
2005-05-15 00:30:29 +08:00
|
|
|
|
|
|
|
</sect2>
|
|
|
|
|
|
|
|
<sect2 role="installation">
|
|
|
|
<title>Installation of Stunnel</title>
|
|
|
|
|
|
|
|
<para>The <command>stunnel</command> daemon will be run in a
|
|
|
|
<command>chroot</command> jail by an unprivileged user. Create the
|
|
|
|
new user, group and <command>chroot</command> home directory structure
|
2005-07-21 02:28:37 +08:00
|
|
|
using the following commands as the
|
|
|
|
<systemitem class="username">root</systemitem> user:</para>
|
2005-05-15 00:30:29 +08:00
|
|
|
|
2005-06-06 05:06:40 +08:00
|
|
|
<screen role="root"><userinput>groupadd -g 51 stunnel &&
|
2005-01-13 10:04:28 +08:00
|
|
|
useradd -c "Stunnel Daemon" -d /var/lib/stunnel \
|
2005-06-06 05:06:40 +08:00
|
|
|
-g stunnel -s /bin/false -u 51 stunnel &&
|
2006-03-31 10:07:53 +08:00
|
|
|
install -v -m 1770 -o stunnel -g stunnel -d /var/lib/stunnel/run</userinput></screen>
|
2005-05-15 00:30:29 +08:00
|
|
|
|
|
|
|
<note>
|
|
|
|
<para>A signed SSL Certificate and a Private Key is necessary to run
|
|
|
|
the <command>stunnel</command> daemon. If you own, or have already
|
|
|
|
created a signed SSL Certificate you wish to use, copy it to
|
2005-07-21 02:28:37 +08:00
|
|
|
<filename>/etc/stunnel/stunnel.pem</filename> before starting the build
|
2005-07-27 04:39:59 +08:00
|
|
|
(ensure only <systemitem class='username'>root</systemitem> has read and
|
|
|
|
write access), otherwise you will be
|
2005-07-21 02:28:37 +08:00
|
|
|
prompted to create one during the installation process. The
|
2005-12-16 23:50:53 +08:00
|
|
|
<filename class='extension'>.pem</filename> file must be formatted as
|
|
|
|
shown below:</para>
|
2005-05-15 00:30:29 +08:00
|
|
|
|
|
|
|
<screen><literal>-----BEGIN RSA PRIVATE KEY-----
|
2004-10-28 02:22:58 +08:00
|
|
|
<replaceable>[many encrypted lines of unencrypted key]</replaceable>
|
|
|
|
-----END RSA PRIVATE KEY-----
|
|
|
|
-----BEGIN CERTIFICATE-----
|
|
|
|
<replaceable>[many encrypted lines of certificate]</replaceable>
|
2006-03-31 10:07:53 +08:00
|
|
|
-----END CERTIFICATE-----</literal></screen>
|
2005-05-15 00:30:29 +08:00
|
|
|
</note>
|
2004-10-28 02:22:58 +08:00
|
|
|
|
2005-05-15 00:30:29 +08:00
|
|
|
<para>Install <application>Stunnel</application> by running the following
|
|
|
|
commands:</para>
|
|
|
|
|
2006-03-31 10:07:53 +08:00
|
|
|
<screen><userinput>sed -i -e 's|nogroup|stunnel|' \
|
|
|
|
-e 's|$(prefix)/var/lib|$(localstatedir)|' \
|
|
|
|
tools/Makefile.in
|
|
|
|
sed -i 's|doc/stunnel|&-$(VERSION)|' {,doc/,tools/}Makefile.in &&
|
|
|
|
|
|
|
|
./configure --prefix=/usr --sysconfdir=/etc \
|
2005-11-22 02:52:31 +08:00
|
|
|
--localstatedir=/var/lib --disable-libwrap &&
|
2005-05-15 00:30:29 +08:00
|
|
|
make</userinput></screen>
|
|
|
|
|
2005-07-21 02:28:37 +08:00
|
|
|
<para>This package does not come with a test suite.</para>
|
|
|
|
|
2005-05-15 00:30:29 +08:00
|
|
|
<para>Now, as the <systemitem class="username">root</systemitem> user:</para>
|
2005-01-27 11:26:52 +08:00
|
|
|
|
2005-05-15 00:30:29 +08:00
|
|
|
<screen role="root"><userinput>make install</userinput></screen>
|
2005-01-27 11:26:52 +08:00
|
|
|
|
2005-05-15 00:30:29 +08:00
|
|
|
</sect2>
|
2004-10-28 02:22:58 +08:00
|
|
|
|
2005-05-15 00:30:29 +08:00
|
|
|
<sect2 role="commands">
|
|
|
|
<title>Command Explanations</title>
|
2004-10-28 02:22:58 +08:00
|
|
|
|
2006-03-31 10:07:53 +08:00
|
|
|
<para><command>sed -i -e '...' -e '...' tools/Makefile.in</command>:
|
|
|
|
This <command>sed</command> command modifies the group and directory
|
|
|
|
used for the <command>chroot</command> jail to conform with the parameters
|
|
|
|
created earlier.</para>
|
|
|
|
|
|
|
|
<para><command>sed -i '...' {,doc/,tools/}Makefile.in</command>: This
|
|
|
|
<command>sed</command> command modifies the location of the installed
|
|
|
|
docs to a versioned directory.</para>
|
|
|
|
|
2005-05-15 00:30:29 +08:00
|
|
|
<para><parameter>--sysconfdir=/etc</parameter>: This parameter forces
|
|
|
|
the configuration directory to <filename class='directory'>/etc</filename>
|
|
|
|
instead of <filename class='directory'>/usr/etc</filename>.</para>
|
2004-10-28 02:22:58 +08:00
|
|
|
|
2005-05-15 00:30:29 +08:00
|
|
|
<para><parameter>--localstatedir=/var/lib</parameter>: This parameter
|
2006-03-31 10:07:53 +08:00
|
|
|
sets the installation to use
|
2005-05-15 00:30:29 +08:00
|
|
|
<filename class='directory'>/var/lib/stunnel</filename> instead of
|
2006-03-31 10:07:53 +08:00
|
|
|
creating and using
|
2005-05-15 00:30:29 +08:00
|
|
|
<filename class='directory'>/usr/var/stunnel</filename>.</para>
|
2004-10-28 02:22:58 +08:00
|
|
|
|
2005-11-22 02:52:31 +08:00
|
|
|
<para><parameter>--disable-libwrap</parameter>: This parameter is required
|
|
|
|
if you don't have <application>tcpwrappers</application> installed. Remove
|
|
|
|
the parameter if <application>tcpwrappers</application> is installed.</para>
|
|
|
|
|
2005-05-15 00:30:29 +08:00
|
|
|
<para><command>make install</command>: This command installs the package
|
|
|
|
and, if you did not copy an <filename>stunnel.pem</filename> file to the
|
|
|
|
<filename class='directory'>/etc/stunnel</filename> directory, prompts you
|
|
|
|
for the necessary information to create one. Ensure you reply to the</para>
|
2005-01-05 10:29:48 +08:00
|
|
|
|
2005-05-15 00:30:29 +08:00
|
|
|
<screen><prompt>Common Name (FQDN of your server) [localhost]:</prompt></screen>
|
2004-10-28 02:22:58 +08:00
|
|
|
|
2005-05-15 00:30:29 +08:00
|
|
|
<para>prompt with the name or IP address you will be using
|
2005-07-21 02:28:37 +08:00
|
|
|
to access the service(s).</para>
|
2004-10-28 02:22:58 +08:00
|
|
|
|
2005-05-15 00:30:29 +08:00
|
|
|
</sect2>
|
2004-10-28 02:22:58 +08:00
|
|
|
|
2005-05-15 00:30:29 +08:00
|
|
|
<sect2 role="configuration">
|
|
|
|
<title>Configuring Stunnel</title>
|
2004-10-28 02:22:58 +08:00
|
|
|
|
2005-05-15 00:30:29 +08:00
|
|
|
<sect3 id="stunnel-config">
|
|
|
|
<title>Config Files</title>
|
2004-10-28 02:22:58 +08:00
|
|
|
|
2005-05-15 00:30:29 +08:00
|
|
|
<para><filename>/etc/stunnel/stunnel.conf</filename></para>
|
2004-10-28 02:22:58 +08:00
|
|
|
|
2005-05-15 00:30:29 +08:00
|
|
|
<indexterm zone="stunnel stunnel-config">
|
|
|
|
<primary sortas="e-etc-stunnel-stunnel.conf">/etc/stunnel/stunnel.conf</primary>
|
|
|
|
</indexterm>
|
2004-10-28 02:22:58 +08:00
|
|
|
|
2005-05-15 00:30:29 +08:00
|
|
|
</sect3>
|
2004-10-28 02:22:58 +08:00
|
|
|
|
2005-05-15 00:30:29 +08:00
|
|
|
<sect3>
|
|
|
|
<title>Configuration Information</title>
|
|
|
|
|
|
|
|
<para>Create a basic <filename>/etc/stunnel/stunnel.conf</filename>
|
|
|
|
configuration file using the following commands:</para>
|
|
|
|
|
2005-12-16 23:50:53 +08:00
|
|
|
<screen role="root"><userinput>cat >/etc/stunnel/stunnel.conf << "EOF" &&
|
2005-05-15 00:30:29 +08:00
|
|
|
<literal># File: /etc/stunnel/stunnel.conf
|
2004-10-28 02:22:58 +08:00
|
|
|
|
|
|
|
pid = /run/stunnel.pid
|
|
|
|
chroot = /var/lib/stunnel
|
|
|
|
client = no
|
|
|
|
setuid = stunnel
|
2005-05-15 00:30:29 +08:00
|
|
|
setgid = stunnel</literal>
|
2004-10-28 02:22:58 +08:00
|
|
|
|
2005-12-16 23:50:53 +08:00
|
|
|
EOF
|
|
|
|
chmod -v 644 /etc/stunnel/stunnel.conf</userinput></screen>
|
2004-10-28 02:22:58 +08:00
|
|
|
|
2005-07-21 02:28:37 +08:00
|
|
|
<para>Next, you need to add the service(s) you wish to encrypt to the
|
2005-05-15 00:30:29 +08:00
|
|
|
configuration file. The format is as follows:</para>
|
2004-10-28 02:22:58 +08:00
|
|
|
|
2005-05-15 00:30:29 +08:00
|
|
|
<screen><literal>[<replaceable>[service]</replaceable>]
|
2004-10-28 02:22:58 +08:00
|
|
|
accept = <replaceable>[hostname:portnumber]</replaceable>
|
2005-05-15 00:30:29 +08:00
|
|
|
connect = <replaceable>[hostname:portnumber]</replaceable></literal></screen>
|
|
|
|
|
|
|
|
<para>If you use <application>Stunnel</application> to encrypt a daemon
|
|
|
|
started from <command>[x]inetd</command>, you may need to disable that
|
|
|
|
daemon in the <filename>/etc/[x]inetd.conf</filename> file and enable a
|
|
|
|
corresponding <replaceable>[service]</replaceable>_stunnel service. You
|
|
|
|
may have to add an appropriate entry in <filename>/etc/services</filename>
|
|
|
|
as well.</para>
|
|
|
|
|
|
|
|
<para>For a full explanation of the commands and syntax used in the
|
|
|
|
configuration file, run <command>man stunnel</command>. To see a
|
|
|
|
BLFS example of an actual setup of an <command>stunnel</command> encrypted
|
|
|
|
service, read the <xref linkend="samba3-swat-config"/> in the
|
|
|
|
<application>Samba</application> instructions.</para>
|
|
|
|
|
|
|
|
</sect3>
|
|
|
|
|
|
|
|
<sect3 id="stunnel-init">
|
|
|
|
<title>Boot Script</title>
|
|
|
|
|
|
|
|
<para>To automatically start the <command>stunnel</command> daemon
|
|
|
|
when the system is rebooted, install the
|
|
|
|
<filename>/etc/rc.d/init.d/stunnel</filename> bootscript from the
|
2005-12-29 09:38:36 +08:00
|
|
|
<xref linkend="bootscripts"/> package.</para>
|
2005-05-15 00:30:29 +08:00
|
|
|
|
|
|
|
<indexterm zone="stunnel stunnel-init">
|
|
|
|
<primary sortas="f-stunnel">stunnel</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<screen role="root"><userinput>make install-stunnel</userinput></screen>
|
|
|
|
|
|
|
|
</sect3>
|
|
|
|
|
|
|
|
</sect2>
|
|
|
|
|
|
|
|
<sect2 role="content">
|
|
|
|
<title>Contents</title>
|
|
|
|
|
|
|
|
<segmentedlist>
|
|
|
|
<segtitle>Installed Programs</segtitle>
|
|
|
|
<segtitle>Installed Library</segtitle>
|
|
|
|
<segtitle>Installed Directories</segtitle>
|
|
|
|
|
|
|
|
<seglistitem>
|
|
|
|
<seg>stunnel and stunnel3</seg>
|
|
|
|
<seg>libstunnel.so</seg>
|
2006-03-31 10:07:53 +08:00
|
|
|
<seg>/etc/stunnel, /var/lib/stunnel and
|
|
|
|
/usr/share/doc/stunnel-&stunnel-version;</seg>
|
2005-05-15 00:30:29 +08:00
|
|
|
</seglistitem>
|
|
|
|
</segmentedlist>
|
|
|
|
|
|
|
|
<variablelist>
|
|
|
|
<bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
|
|
|
<?dbfo list-presentation="list"?>
|
2005-05-22 20:39:40 +08:00
|
|
|
<?dbhtml list-presentation="table"?>
|
2005-05-15 00:30:29 +08:00
|
|
|
|
|
|
|
<varlistentry id="stunnel-prog">
|
|
|
|
<term><command>stunnel</command></term>
|
|
|
|
<listitem>
|
|
|
|
<para> is a program designed to work as an SSL
|
|
|
|
encryption wrapper between remote clients and local
|
|
|
|
(<command>[x]inetd</command>-startable) or remote servers.</para>
|
|
|
|
<indexterm zone="stunnel stunnel-prog">
|
|
|
|
<primary sortas="b-stunnel">stunnel</primary>
|
|
|
|
</indexterm>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry id="stunnel3">
|
|
|
|
<term><command>stunnel3</command></term>
|
|
|
|
<listitem>
|
|
|
|
<para>is a <application>Perl</application> wrapper script to use
|
|
|
|
<command>stunnel</command> 3.x syntax with <command>stunnel</command>
|
|
|
|
>=4.05.</para>
|
|
|
|
<indexterm zone="stunnel stunnel3">
|
|
|
|
<primary sortas="b-stunnel3">stunnel3</primary>
|
|
|
|
</indexterm>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry id="libstunnel">
|
|
|
|
<term><filename class='libraryfile'>libstunnel.so</filename></term>
|
|
|
|
<listitem>
|
|
|
|
<para> contains the API functions required by
|
|
|
|
<application>Stunnel</application>.</para>
|
|
|
|
<indexterm zone="stunnel libstunnel">
|
|
|
|
<primary sortas="c-libstunnel">libstunnel.so</primary>
|
|
|
|
</indexterm>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
</variablelist>
|
|
|
|
|
|
|
|
</sect2>
|
2004-10-28 02:22:58 +08:00
|
|
|
|
|
|
|
</sect1>
|