[2a7d6c3e] | 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">
|
---|
[0ef1837] | 9 | <!ENTITY stunnel-size "486 KB">
|
---|
| 10 | <!ENTITY stunnel-buildsize "3.9 MB">
|
---|
| 11 | <!ENTITY stunnel-time "0.11 SBU">
|
---|
[2a7d6c3e] | 12 | ]>
|
---|
| 13 |
|
---|
[0ef1837] | 14 | <sect1 id="stunnel-package" xreflabel="Stunnel-&stunnel-version;">
|
---|
[2a7d6c3e] | 15 | <sect1info>
|
---|
| 16 | <othername>$LastChangedBy$</othername>
|
---|
| 17 | <date>$Date$</date>
|
---|
| 18 | </sect1info>
|
---|
| 19 | <?dbhtml filename="stunnel.html"?>
|
---|
| 20 | <title>Stunnel-&stunnel-version;</title>
|
---|
[0ef1837] | 21 | <indexterm zone="stunnel-package">
|
---|
[6a2bce2] | 22 | <primary sortas="a-Stunnel">Stunnel</primary></indexterm>
|
---|
[2a7d6c3e] | 23 |
|
---|
| 24 | <sect2>
|
---|
| 25 | <title>Introduction to <application>Stunnel</application></title>
|
---|
| 26 |
|
---|
| 27 | <para>The <application>Stunnel</application> package contains a program that
|
---|
| 28 | allows you to encrypt arbitrary <acronym>TCP</acronym> connections inside
|
---|
| 29 | <acronym>SSL</acronym> (Secure Sockets Layer) so you can easily communicate
|
---|
| 30 | with clients over secure channels. <application>Stunnel</application> can be
|
---|
| 31 | used to add <acronym>SSL</acronym> functionality to commonly used Inetd
|
---|
| 32 | daemons 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>,
|
---|
| 35 | and in tunneling <acronym>PPP</acronym> over network sockets without changes
|
---|
| 36 | to the server package source code.</para>
|
---|
| 37 |
|
---|
| 38 | <sect3><title>Package information</title>
|
---|
| 39 | <itemizedlist spacing="compact">
|
---|
[0ef1837] | 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>
|
---|
[2a7d6c3e] | 50 | </sect3>
|
---|
| 51 |
|
---|
| 52 | <sect3><title><application>Stunnel</application> dependencies</title>
|
---|
| 53 | <sect4><title>Required</title>
|
---|
[939cf0da] | 54 | <para><xref linkend="openssl-package"/></para>
|
---|
[2a7d6c3e] | 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,
|
---|
| 69 | group and <command>chroot</command> home directory structure using the
|
---|
| 70 | following commands:</para>
|
---|
| 71 |
|
---|
| 72 | <screen><userinput><command>groupadd stunnel &&
|
---|
[8d9eb0f] | 73 | useradd -c "Stunnel Daemon" -d /var/lib/stunnel \
|
---|
| 74 | -g stunnel -s /bin/false stunnel &&
|
---|
[2a7d6c3e] | 75 | install -d -m 700 -o stunnel -g stunnel /var/lib/stunnel/run</command></userinput></screen>
|
---|
| 76 |
|
---|
[2bfe939] | 77 | <note><para>A signed <acronym>SSL</acronym> Certificate and a Private Key is
|
---|
| 78 | necessary to run the <command>stunnel</command> daemon. If you own, or have
|
---|
| 79 | already created a signed <acronym>SSL</acronym> Certificate you wish to use,
|
---|
| 80 | copy it to <filename>tools/stunnel.pem</filename> in the source directory
|
---|
| 81 | before starting the build, otherwise you will be prompted to create one. The
|
---|
[2a7d6c3e] | 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
|
---|
| 92 | commands:</para>
|
---|
| 93 |
|
---|
[0ef1837] | 94 | <screen><userinput><command>./configure --prefix=/usr --sysconfdir=/etc \
|
---|
| 95 | --localstatedir=/var/lib/stunnel &&
|
---|
[2a7d6c3e] | 96 | make &&
|
---|
| 97 | make install</command></userinput></screen>
|
---|
| 98 |
|
---|
| 99 | </sect2>
|
---|
| 100 |
|
---|
| 101 | <sect2>
|
---|
| 102 | <title>Command explanations</title>
|
---|
| 103 |
|
---|
| 104 | <para><parameter>--sysconfdir=/etc</parameter>: This parameter forces the
|
---|
| 105 | configuration directory to <filename class='directory'>/etc</filename> instead
|
---|
| 106 | of <filename class='directory'>/usr/etc</filename>.</para>
|
---|
| 107 |
|
---|
[0ef1837] | 108 | <para><parameter>--localstatedir=/var/lib/stunnel</parameter>: This parameter
|
---|
| 109 | causes the installation process to create
|
---|
| 110 | <filename class='directory'>/var/lib/stunnel/stunnel</filename> instead of
|
---|
| 111 | <filename class='directory'>/usr/var/stunnel</filename>.</para>
|
---|
| 112 |
|
---|
[2a7d6c3e] | 113 | <para><command>make</command>: This command builds the package and, if you
|
---|
| 114 | did not copy an <filename>stunnel.pem</filename> file to the source
|
---|
| 115 | <filename class='directory'>tools/</filename> directory, prompts you for the
|
---|
| 116 | necessary information to create one. Ensure you reply to the</para>
|
---|
| 117 |
|
---|
| 118 | <screen><computeroutput>Common Name (FQDN of your server) [localhost]:</computeroutput></screen>
|
---|
| 119 |
|
---|
| 120 | <para>prompt with the name or <acronym>IP</acronym> address you will be using
|
---|
| 121 | to access the service.</para>
|
---|
| 122 |
|
---|
| 123 | </sect2>
|
---|
| 124 |
|
---|
| 125 | <sect2>
|
---|
| 126 | <title>Configuring <application>Stunnel</application></title>
|
---|
| 127 |
|
---|
[40851cf] | 128 | <sect3 id="stunnel-config"><title>Config files</title>
|
---|
| 129 | <para><filename>/etc/stunnel/stunnel.conf</filename></para>
|
---|
| 130 | <indexterm zone="stunnel-package stunnel-config">
|
---|
[0cd6d67] | 131 | <primary sortas="e-etc-stunnel-stunnel.conf">/etc/stunnel/stunnel.conf</primary>
|
---|
[40851cf] | 132 | </indexterm>
|
---|
[2a7d6c3e] | 133 | </sect3>
|
---|
| 134 |
|
---|
| 135 | <sect3><title>Configuration Information</title>
|
---|
| 136 |
|
---|
| 137 | <para>Create a basic <filename>/etc/stunnel/stunnel.conf</filename>
|
---|
| 138 | configuration file using the following commands:</para>
|
---|
| 139 |
|
---|
| 140 | <screen><userinput><command>cat >/etc/stunnel/stunnel.conf << "EOF"</command>
|
---|
| 141 | # File: /etc/stunnel/stunnel.conf
|
---|
| 142 |
|
---|
| 143 | pid = /run/stunnel.pid
|
---|
| 144 | chroot = /var/lib/stunnel
|
---|
| 145 | client = no
|
---|
| 146 | setuid = stunnel
|
---|
| 147 | setgid = stunnel
|
---|
| 148 |
|
---|
| 149 | <command>EOF</command></userinput></screen>
|
---|
| 150 |
|
---|
| 151 | <para>Next, you need to add the service you wish to encrypt to the
|
---|
| 152 | configuration file. The format is as follows:</para>
|
---|
| 153 |
|
---|
| 154 | <screen><userinput>[<replaceable>[service]</replaceable>]
|
---|
| 155 | accept = <replaceable>[hostname:portnumber]</replaceable>
|
---|
| 156 | connect = <replaceable>[hostname:portnumber]</replaceable></userinput></screen>
|
---|
| 157 |
|
---|
| 158 | <para>If you use <application>Stunnel</application> to encrypt a daemon
|
---|
| 159 | started from <command>[x]inetd</command>, you may need to disable that daemon
|
---|
| 160 | in the <filename>/etc/[x]inetd.conf</filename> file and enable a corresponding
|
---|
| 161 | <replaceable>[service]</replaceable>_stunnel service. You may have to add an
|
---|
| 162 | appropriate entry in <filename>/etc/services</filename> as well.</para>
|
---|
| 163 |
|
---|
| 164 | <para>For a full explanation of the commands and syntax used in the
|
---|
| 165 | configuration file, run <command>man stunnel</command>. To see a
|
---|
| 166 | <acronym>BLFS</acronym> example of an actual setup of an
|
---|
| 167 | <command>stunnel</command> encrypted service, read the
|
---|
| 168 | <acronym>SWAT</acronym> configuration section in the <xref linkend="samba3"/>
|
---|
| 169 | instructions.</para>
|
---|
| 170 |
|
---|
[9f6698c] | 171 | <para id="stunnel.init">To automatically start the <command>stunnel</command>
|
---|
| 172 | daemon when the system is rebooted, install the
|
---|
| 173 | <filename>/etc/rc.d/init.d/stunnel</filename> bootscript from the
|
---|
| 174 | <xref linkend="intro-important-bootscripts"/> package.</para>
|
---|
[0ef1837] | 175 | <indexterm zone="stunnel-package stunnel.init">
|
---|
| 176 | <primary sortas="f-stunnel.init">stunnel</primary></indexterm>
|
---|
[2a7d6c3e] | 177 |
|
---|
| 178 | <screen><userinput><command>make install-stunnel</command></userinput></screen>
|
---|
| 179 | </sect3>
|
---|
| 180 |
|
---|
| 181 | </sect2>
|
---|
| 182 |
|
---|
| 183 | <sect2>
|
---|
| 184 | <title>Contents</title>
|
---|
[0ef1837] | 185 | <segmentedlist>
|
---|
[eeaaf995] | 186 | <segtitle>Installed Programs</segtitle>
|
---|
[0ef1837] | 187 | <segtitle>Installed Library</segtitle>
|
---|
| 188 | <segtitle>Installed Directories</segtitle>
|
---|
| 189 | <seglistitem>
|
---|
[eeaaf995] | 190 | <seg>stunnel and stunnel3</seg>
|
---|
[0ef1837] | 191 | <seg>libstunnel.so</seg>
|
---|
| 192 | <seg>/etc/stunnel, /var/lib/stunnel and
|
---|
| 193 | /usr/share/doc/stunnel</seg></seglistitem>
|
---|
| 194 | </segmentedlist>
|
---|
| 195 |
|
---|
| 196 | <variablelist>
|
---|
| 197 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 198 | <?dbfo list-presentation="list"?>
|
---|
| 199 |
|
---|
| 200 | <varlistentry id="stunnel">
|
---|
| 201 | <term><command>stunnel</command></term>
|
---|
| 202 | <listitem><para> is a program designed to work as an <acronym>SSL</acronym>
|
---|
| 203 | encryption wrapper between remote clients and local
|
---|
| 204 | (<command>[x]inetd</command>-startable) or remote servers.</para>
|
---|
| 205 | <indexterm zone="stunnel-package stunnel">
|
---|
| 206 | <primary sortas="b-stunnel">stunnel</primary></indexterm>
|
---|
| 207 | </listitem>
|
---|
| 208 | </varlistentry>
|
---|
| 209 |
|
---|
| 210 | <varlistentry id="stunnel3">
|
---|
| 211 | <term><command>stunnel3</command></term>
|
---|
| 212 | <listitem><para>is a <application>Perl</application> wrapper script to use
|
---|
| 213 | <command>stunnel</command> 3.x syntax with <command>stunnel</command>
|
---|
| 214 | >=4.05.</para>
|
---|
| 215 | <indexterm zone="stunnel-package stunnel3">
|
---|
[eeaaf995] | 216 | <primary sortas="b-stunnel3">stunnel3</primary></indexterm>
|
---|
[0ef1837] | 217 | </listitem>
|
---|
| 218 | </varlistentry>
|
---|
| 219 |
|
---|
[9f6698c] | 220 | <varlistentry id="libstunnel">
|
---|
[0ef1837] | 221 | <term><filename class='libraryfile'>libstunnel.so</filename></term>
|
---|
| 222 | <listitem><para> contains the <acronym>API</acronym> functions required by
|
---|
| 223 | <application>Stunnel</application>.</para>
|
---|
[9f6698c] | 224 | <indexterm zone="stunnel-package libstunnel">
|
---|
| 225 | <primary sortas="c-libstunnel">libstunnel.so</primary></indexterm>
|
---|
[0ef1837] | 226 | </listitem>
|
---|
| 227 | </varlistentry>
|
---|
| 228 | </variablelist>
|
---|
[2a7d6c3e] | 229 |
|
---|
| 230 | </sect2>
|
---|
| 231 |
|
---|
| 232 | </sect1>
|
---|
| 233 |
|
---|