2004-10-28 02:22:58 +08:00
|
|
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
2005-04-02 23:59:17 +08:00
|
|
|
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
|
2004-10-28 02:22:58 +08:00
|
|
|
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
|
|
|
<!ENTITY % general-entities SYSTEM "../../general.ent">
|
|
|
|
%general-entities;
|
|
|
|
|
|
|
|
<!ENTITY stunnel-download-http "http://www.stunnel.org/download/stunnel/src/stunnel-&stunnel-version;.tar.gz">
|
|
|
|
<!ENTITY stunnel-download-ftp "ftp://ftp.fu-berlin.de/unix/linux/mirrors/gentoo/distfiles/stunnel-&stunnel-version;.tar.gz">
|
2005-02-05 02:58:22 +08:00
|
|
|
<!ENTITY stunnel-md5sum "7d53af550a1c2e01e146b936e58b8860">
|
2005-01-05 10:29:48 +08:00
|
|
|
<!ENTITY stunnel-size "486 KB">
|
|
|
|
<!ENTITY stunnel-buildsize "3.9 MB">
|
|
|
|
<!ENTITY stunnel-time "0.11 SBU">
|
2004-10-28 02:22:58 +08:00
|
|
|
]>
|
|
|
|
|
2005-01-26 03:21:25 +08:00
|
|
|
<sect1 id="stunnel" xreflabel="Stunnel-&stunnel-version;">
|
2004-10-28 02:22:58 +08:00
|
|
|
<sect1info>
|
|
|
|
<othername>$LastChangedBy$</othername>
|
|
|
|
<date>$Date$</date>
|
|
|
|
</sect1info>
|
|
|
|
<?dbhtml filename="stunnel.html"?>
|
|
|
|
<title>Stunnel-&stunnel-version;</title>
|
2005-01-26 03:21:25 +08:00
|
|
|
<indexterm zone="stunnel">
|
2005-01-17 00:56:15 +08:00
|
|
|
<primary sortas="a-Stunnel">Stunnel</primary></indexterm>
|
2004-10-28 02:22:58 +08:00
|
|
|
|
|
|
|
<sect2>
|
|
|
|
<title>Introduction to <application>Stunnel</application></title>
|
|
|
|
|
|
|
|
<para>The <application>Stunnel</application> package contains a program that
|
|
|
|
allows you to encrypt arbitrary <acronym>TCP</acronym> connections inside
|
|
|
|
<acronym>SSL</acronym> (Secure Sockets Layer) so you can easily communicate
|
|
|
|
with clients over secure channels. <application>Stunnel</application> can be
|
|
|
|
used to add <acronym>SSL</acronym> functionality to commonly used Inetd
|
|
|
|
daemons like <acronym>POP</acronym>-2, <acronym>POP</acronym>-3, and
|
|
|
|
<acronym>IMAP</acronym> servers, to standalone daemons like
|
|
|
|
<acronym>NNTP</acronym>, <acronym>SMTP</acronym> and <acronym>HTTP</acronym>,
|
|
|
|
and in tunneling <acronym>PPP</acronym> over network sockets without changes
|
|
|
|
to the server package source code.</para>
|
|
|
|
|
|
|
|
<sect3><title>Package information</title>
|
|
|
|
<itemizedlist spacing="compact">
|
2005-01-05 10:29:48 +08:00
|
|
|
<listitem><para>Download (HTTP):
|
|
|
|
<ulink url="&stunnel-download-http;"/></para></listitem>
|
|
|
|
<listitem><para>Download (FTP):
|
|
|
|
<ulink url="&stunnel-download-ftp;"/></para></listitem>
|
2005-02-05 02:58:22 +08:00
|
|
|
<listitem><para>Download MD5 sum:
|
|
|
|
&stunnel-md5sum;</para></listitem>
|
2005-01-05 10:29:48 +08:00
|
|
|
<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>
|
2004-10-28 02:22:58 +08:00
|
|
|
</sect3>
|
|
|
|
|
|
|
|
<sect3><title><application>Stunnel</application> dependencies</title>
|
|
|
|
<sect4><title>Required</title>
|
2005-01-26 00:02:00 +08:00
|
|
|
<para><xref linkend="openssl"/></para>
|
2004-10-28 02:22:58 +08:00
|
|
|
</sect4>
|
|
|
|
|
|
|
|
<sect4><title>Optional</title>
|
|
|
|
<para><xref linkend="tcpwrappers"/></para>
|
|
|
|
</sect4>
|
|
|
|
</sect3>
|
|
|
|
|
|
|
|
</sect2>
|
|
|
|
|
|
|
|
<sect2>
|
|
|
|
<title>Installation of <application>Stunnel</application></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 using the
|
2005-01-27 11:26:52 +08:00
|
|
|
following commands as the root user:</para>
|
2004-10-28 02:22:58 +08:00
|
|
|
|
2005-01-27 11:26:52 +08:00
|
|
|
<screen><userinput role='root'><command>groupadd stunnel &&
|
2005-01-13 10:04:28 +08:00
|
|
|
useradd -c "Stunnel Daemon" -d /var/lib/stunnel \
|
|
|
|
-g stunnel -s /bin/false stunnel &&
|
2004-10-28 02:22:58 +08:00
|
|
|
install -d -m 700 -o stunnel -g stunnel /var/lib/stunnel/run</command></userinput></screen>
|
|
|
|
|
2004-10-28 13:50:36 +08:00
|
|
|
<note><para>A signed <acronym>SSL</acronym> Certificate and a Private Key is
|
|
|
|
necessary to run the <command>stunnel</command> daemon. If you own, or have
|
|
|
|
already created a signed <acronym>SSL</acronym> Certificate you wish to use,
|
|
|
|
copy it to <filename>tools/stunnel.pem</filename> in the source directory
|
|
|
|
before starting the build, otherwise you will be prompted to create one. The
|
2004-10-28 02:22:58 +08:00
|
|
|
<filename>.pem</filename> file must be formatted as shown below:</para>
|
|
|
|
|
|
|
|
<screen>-----BEGIN RSA PRIVATE KEY-----
|
|
|
|
<replaceable>[many encrypted lines of unencrypted key]</replaceable>
|
|
|
|
-----END RSA PRIVATE KEY-----
|
|
|
|
-----BEGIN CERTIFICATE-----
|
|
|
|
<replaceable>[many encrypted lines of certificate]</replaceable>
|
|
|
|
-----END CERTIFICATE-----</screen></note>
|
|
|
|
|
|
|
|
<para>Install <application>Stunnel</application> by running the following
|
|
|
|
commands:</para>
|
|
|
|
|
2005-01-05 10:29:48 +08:00
|
|
|
<screen><userinput><command>./configure --prefix=/usr --sysconfdir=/etc \
|
|
|
|
--localstatedir=/var/lib/stunnel &&
|
2005-01-27 11:26:52 +08:00
|
|
|
make</command></userinput></screen>
|
|
|
|
|
|
|
|
<para>Now, as the root user:</para>
|
|
|
|
|
|
|
|
<screen><userinput role='root'><command>make install</command></userinput></screen>
|
2004-10-28 02:22:58 +08:00
|
|
|
|
|
|
|
</sect2>
|
|
|
|
|
|
|
|
<sect2>
|
|
|
|
<title>Command explanations</title>
|
|
|
|
|
|
|
|
<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>
|
|
|
|
|
2005-01-05 10:29:48 +08:00
|
|
|
<para><parameter>--localstatedir=/var/lib/stunnel</parameter>: This parameter
|
|
|
|
causes the installation process to create
|
|
|
|
<filename class='directory'>/var/lib/stunnel/stunnel</filename> instead of
|
|
|
|
<filename class='directory'>/usr/var/stunnel</filename>.</para>
|
|
|
|
|
2004-10-28 02:22:58 +08:00
|
|
|
<para><command>make</command>: This command builds the package and, if you
|
|
|
|
did not copy an <filename>stunnel.pem</filename> file to the source
|
|
|
|
<filename class='directory'>tools/</filename> directory, prompts you for the
|
|
|
|
necessary information to create one. Ensure you reply to the</para>
|
|
|
|
|
|
|
|
<screen><computeroutput>Common Name (FQDN of your server) [localhost]:</computeroutput></screen>
|
|
|
|
|
|
|
|
<para>prompt with the name or <acronym>IP</acronym> address you will be using
|
|
|
|
to access the service.</para>
|
|
|
|
|
|
|
|
</sect2>
|
|
|
|
|
|
|
|
<sect2>
|
|
|
|
<title>Configuring <application>Stunnel</application></title>
|
|
|
|
|
2005-01-11 05:05:41 +08:00
|
|
|
<sect3 id="stunnel-config"><title>Config files</title>
|
|
|
|
<para><filename>/etc/stunnel/stunnel.conf</filename></para>
|
2005-01-26 03:21:25 +08:00
|
|
|
<indexterm zone="stunnel stunnel-config">
|
2005-01-12 12:36:51 +08:00
|
|
|
<primary sortas="e-etc-stunnel-stunnel.conf">/etc/stunnel/stunnel.conf</primary>
|
2005-01-11 05:05:41 +08:00
|
|
|
</indexterm>
|
2004-10-28 02:22:58 +08:00
|
|
|
</sect3>
|
|
|
|
|
|
|
|
<sect3><title>Configuration Information</title>
|
|
|
|
|
|
|
|
<para>Create a basic <filename>/etc/stunnel/stunnel.conf</filename>
|
|
|
|
configuration file using the following commands:</para>
|
|
|
|
|
2005-01-27 11:26:52 +08:00
|
|
|
<screen><userinput role='root'><command>cat >/etc/stunnel/stunnel.conf << "EOF"</command>
|
2004-10-28 02:22:58 +08:00
|
|
|
# File: /etc/stunnel/stunnel.conf
|
|
|
|
|
|
|
|
pid = /run/stunnel.pid
|
|
|
|
chroot = /var/lib/stunnel
|
|
|
|
client = no
|
|
|
|
setuid = stunnel
|
|
|
|
setgid = stunnel
|
|
|
|
|
|
|
|
<command>EOF</command></userinput></screen>
|
|
|
|
|
|
|
|
<para>Next, you need to add the service you wish to encrypt to the
|
|
|
|
configuration file. The format is as follows:</para>
|
|
|
|
|
2005-01-27 11:26:52 +08:00
|
|
|
<screen><userinput role='root'>[<replaceable>[service]</replaceable>]
|
2004-10-28 02:22:58 +08:00
|
|
|
accept = <replaceable>[hostname:portnumber]</replaceable>
|
|
|
|
connect = <replaceable>[hostname:portnumber]</replaceable></userinput></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
|
|
|
|
<acronym>BLFS</acronym> example of an actual setup of an
|
|
|
|
<command>stunnel</command> encrypted service, read the
|
2005-02-23 14:38:15 +08:00
|
|
|
<xref linkend="samba3-swat-config"/> in the <application>Samba</application>
|
2004-10-28 02:22:58 +08:00
|
|
|
instructions.</para>
|
|
|
|
|
2005-01-07 04:49:25 +08:00
|
|
|
<para id="stunnel.init">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
|
|
|
|
<xref linkend="intro-important-bootscripts"/> package.</para>
|
2005-01-26 03:21:25 +08:00
|
|
|
<indexterm zone="stunnel stunnel.init">
|
2005-01-05 10:29:48 +08:00
|
|
|
<primary sortas="f-stunnel.init">stunnel</primary></indexterm>
|
2004-10-28 02:22:58 +08:00
|
|
|
|
2005-01-27 11:26:52 +08:00
|
|
|
<screen><userinput role='root'><command>make install-stunnel</command></userinput></screen>
|
2004-10-28 02:22:58 +08:00
|
|
|
</sect3>
|
|
|
|
|
|
|
|
</sect2>
|
|
|
|
|
|
|
|
<sect2>
|
|
|
|
<title>Contents</title>
|
2005-01-05 10:29:48 +08:00
|
|
|
<segmentedlist>
|
2005-01-10 07:50:11 +08:00
|
|
|
<segtitle>Installed Programs</segtitle>
|
2005-01-05 10:29:48 +08:00
|
|
|
<segtitle>Installed Library</segtitle>
|
|
|
|
<segtitle>Installed Directories</segtitle>
|
|
|
|
<seglistitem>
|
2005-01-10 07:50:11 +08:00
|
|
|
<seg>stunnel and stunnel3</seg>
|
2005-01-05 10:29:48 +08:00
|
|
|
<seg>libstunnel.so</seg>
|
2005-01-26 03:21:25 +08:00
|
|
|
<seg>/etc/stunnel, /var/lib/stunnel and /usr/share/doc/stunnel</seg>
|
|
|
|
</seglistitem>
|
2005-01-05 10:29:48 +08:00
|
|
|
</segmentedlist>
|
|
|
|
|
|
|
|
<variablelist>
|
|
|
|
<bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
|
|
|
<?dbfo list-presentation="list"?>
|
|
|
|
|
2005-01-26 03:21:25 +08:00
|
|
|
<varlistentry id="stunnel-prog">
|
2005-01-05 10:29:48 +08:00
|
|
|
<term><command>stunnel</command></term>
|
|
|
|
<listitem><para> is a program designed to work as an <acronym>SSL</acronym>
|
|
|
|
encryption wrapper between remote clients and local
|
|
|
|
(<command>[x]inetd</command>-startable) or remote servers.</para>
|
2005-01-26 03:21:25 +08:00
|
|
|
<indexterm zone="stunnel stunnel-prog">
|
2005-01-05 10:29:48 +08:00
|
|
|
<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>
|
2005-01-26 03:21:25 +08:00
|
|
|
<indexterm zone="stunnel stunnel3">
|
2005-01-10 07:50:11 +08:00
|
|
|
<primary sortas="b-stunnel3">stunnel3</primary></indexterm>
|
2005-01-05 10:29:48 +08:00
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
2005-01-07 04:49:25 +08:00
|
|
|
<varlistentry id="libstunnel">
|
2005-01-05 10:29:48 +08:00
|
|
|
<term><filename class='libraryfile'>libstunnel.so</filename></term>
|
|
|
|
<listitem><para> contains the <acronym>API</acronym> functions required by
|
|
|
|
<application>Stunnel</application>.</para>
|
2005-01-26 03:21:25 +08:00
|
|
|
<indexterm zone="stunnel libstunnel">
|
2005-01-07 04:49:25 +08:00
|
|
|
<primary sortas="c-libstunnel">libstunnel.so</primary></indexterm>
|
2005-01-05 10:29:48 +08:00
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
2004-10-28 02:22:58 +08:00
|
|
|
|
|
|
|
</sect2>
|
|
|
|
|
|
|
|
</sect1>
|
|
|
|
|