[2a7d6c3e] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[6732c094] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
[2a7d6c3e] | 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 |
|
---|
[6c70af9b] | 7 | <!ENTITY stunnel-download-http "http://mirrors.zerg.biz/stunnel/stunnel-&stunnel-version;.tar.gz">
|
---|
| 8 | <!ENTITY stunnel-download-ftp "ftp://ftp.stunnel.org/stunnel/stunnel-&stunnel-version;.tar.gz">
|
---|
[2955093] | 9 | <!ENTITY stunnel-md5sum "ac4c4a30bd7a55b6687cbd62d864054c">
|
---|
| 10 | <!ENTITY stunnel-size "532 KB">
|
---|
| 11 | <!ENTITY stunnel-buildsize "6.0 MB">
|
---|
| 12 | <!ENTITY stunnel-time "0.2 SBU">
|
---|
[2a7d6c3e] | 13 | ]>
|
---|
| 14 |
|
---|
[436c2f7e] | 15 | <sect1 id="stunnel" xreflabel="stunnel-&stunnel-version;">
|
---|
[d3469f0] | 16 | <?dbhtml filename="stunnel.html"?>
|
---|
| 17 |
|
---|
| 18 | <sect1info>
|
---|
| 19 | <othername>$LastChangedBy$</othername>
|
---|
| 20 | <date>$Date$</date>
|
---|
| 21 | </sect1info>
|
---|
| 22 |
|
---|
[436c2f7e] | 23 | <title>stunnel-&stunnel-version;</title>
|
---|
[d3469f0] | 24 |
|
---|
| 25 | <indexterm zone="stunnel">
|
---|
[436c2f7e] | 26 | <primary sortas="a-stunnel">stunnel</primary>
|
---|
[d3469f0] | 27 | </indexterm>
|
---|
| 28 |
|
---|
| 29 | <sect2 role="package">
|
---|
[436c2f7e] | 30 | <title>Introduction to stunnel</title>
|
---|
[d3469f0] | 31 |
|
---|
[436c2f7e] | 32 | <para>The <application>stunnel</application> package contains a program
|
---|
[d3469f0] | 33 | that allows you to encrypt arbitrary TCP connections inside SSL (Secure
|
---|
| 34 | Sockets Layer) so you can easily communicate with clients over secure
|
---|
[436c2f7e] | 35 | channels. <application>stunnel</application> can be used to add SSL
|
---|
[d3469f0] | 36 | functionality to commonly used <application>Inetd</application> daemons
|
---|
| 37 | like POP-2, POP-3, and IMAP servers, to standalone daemons like NNTP,
|
---|
| 38 | SMTP and HTTP, and in tunneling PPP over network sockets without changes
|
---|
| 39 | to the server package source code.</para>
|
---|
| 40 |
|
---|
[15fc6d6] | 41 | &lfs74_checked;
|
---|
[ee792ef] | 42 |
|
---|
[d3469f0] | 43 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
| 44 | <itemizedlist spacing="compact">
|
---|
| 45 | <listitem>
|
---|
| 46 | <para>Download (HTTP): <ulink url="&stunnel-download-http;"/></para>
|
---|
| 47 | </listitem>
|
---|
| 48 | <listitem>
|
---|
| 49 | <para>Download (FTP): <ulink url="&stunnel-download-ftp;"/></para>
|
---|
| 50 | </listitem>
|
---|
| 51 | <listitem>
|
---|
| 52 | <para>Download MD5 sum: &stunnel-md5sum;</para>
|
---|
| 53 | </listitem>
|
---|
| 54 | <listitem>
|
---|
| 55 | <para>Download size: &stunnel-size;</para>
|
---|
| 56 | </listitem>
|
---|
| 57 | <listitem>
|
---|
| 58 | <para>Estimated disk space required: &stunnel-buildsize;</para>
|
---|
| 59 | </listitem>
|
---|
| 60 | <listitem>
|
---|
| 61 | <para>Estimated build time: &stunnel-time;</para>
|
---|
| 62 | </listitem>
|
---|
| 63 | </itemizedlist>
|
---|
| 64 |
|
---|
[30ca77d2] | 65 | <!-- <bridgehead renderas="sect3">Additional Downloads</bridgehead>
|
---|
[1ae11c9] | 66 | <itemizedlist spacing="compact">
|
---|
| 67 | <listitem>
|
---|
| 68 | <para>Required patch: <ulink
|
---|
[d45c08c] | 69 | url="&patch-root;/stunnel-&stunnel-version;-setuid-1.patch"/></para>
|
---|
[1ae11c9] | 70 | </listitem>
|
---|
[30ca77d2] | 71 | </itemizedlist> -->
|
---|
[1ae11c9] | 72 |
|
---|
[436c2f7e] | 73 | <bridgehead renderas="sect3">stunnel Dependencies</bridgehead>
|
---|
[d3469f0] | 74 |
|
---|
| 75 | <bridgehead renderas="sect4">Required</bridgehead>
|
---|
[e19ad480] | 76 | <para role="required"><xref linkend="openssl"/></para>
|
---|
[d3469f0] | 77 |
|
---|
[3597eb6] | 78 | <para condition="html" role="usernotes">User Notes:
|
---|
| 79 | <ulink url="&blfs-wiki;/stunnel"/></para>
|
---|
| 80 |
|
---|
[d3469f0] | 81 | </sect2>
|
---|
| 82 |
|
---|
| 83 | <sect2 role="installation">
|
---|
[436c2f7e] | 84 | <title>Installation of stunnel</title>
|
---|
[d3469f0] | 85 |
|
---|
| 86 | <para>The <command>stunnel</command> daemon will be run in a
|
---|
| 87 | <command>chroot</command> jail by an unprivileged user. Create the
|
---|
[1ae11c9] | 88 | new user and group using the following commands as the
|
---|
[50d61ed] | 89 | <systemitem class="username">root</systemitem> user:</para>
|
---|
[d3469f0] | 90 |
|
---|
[b785ab29] | 91 | <screen role="root"><userinput>groupadd -g 51 stunnel &&
|
---|
[436c2f7e] | 92 | useradd -c "stunnel Daemon" -d /var/lib/stunnel \
|
---|
[1ae11c9] | 93 | -g stunnel -s /bin/false -u 51 stunnel</userinput></screen>
|
---|
[d3469f0] | 94 |
|
---|
| 95 | <note>
|
---|
| 96 | <para>A signed SSL Certificate and a Private Key is necessary to run
|
---|
| 97 | the <command>stunnel</command> daemon. If you own, or have already
|
---|
| 98 | created a signed SSL Certificate you wish to use, copy it to
|
---|
[50d61ed] | 99 | <filename>/etc/stunnel/stunnel.pem</filename> before starting the build
|
---|
[823b1a3] | 100 | (ensure only <systemitem class='username'>root</systemitem> has read and
|
---|
| 101 | write access), otherwise you will be
|
---|
[50d61ed] | 102 | prompted to create one during the installation process. The
|
---|
[708f97e9] | 103 | <filename class='extension'>.pem</filename> file must be formatted as
|
---|
| 104 | shown below:</para>
|
---|
[d3469f0] | 105 |
|
---|
[30ca77d2] | 106 | <screen><literal>-----BEGIN PRIVATE KEY-----
|
---|
| 107 | <replaceable><many encrypted lines of private key></replaceable>
|
---|
| 108 | -----END PRIVATE KEY-----
|
---|
[2a7d6c3e] | 109 | -----BEGIN CERTIFICATE-----
|
---|
[3597eb6] | 110 | <replaceable><many encrypted lines of certificate></replaceable>
|
---|
[30ca77d2] | 111 | -----END CERTIFICATE-----
|
---|
| 112 | -----BEGIN DH PARAMETERS-----
|
---|
| 113 | <replaceable><encrypted lines of dh parms></replaceable>
|
---|
| 114 | -----END DH PARAMETERS-----</literal></screen>
|
---|
[d3469f0] | 115 | </note>
|
---|
[2a7d6c3e] | 116 |
|
---|
[436c2f7e] | 117 | <para>Install <application>stunnel</application> by running the following
|
---|
[d3469f0] | 118 | commands:</para>
|
---|
| 119 |
|
---|
[ee792ef] | 120 | <screen><userinput>./configure --prefix=/usr \
|
---|
[e1c116d] | 121 | --sysconfdir=/etc \
|
---|
[30ca77d2] | 122 | --localstatedir=/var \
|
---|
[e1c116d] | 123 | --disable-libwrap &&
|
---|
[d3469f0] | 124 | make</userinput></screen>
|
---|
| 125 |
|
---|
[50d61ed] | 126 | <para>This package does not come with a test suite.</para>
|
---|
| 127 |
|
---|
[d3469f0] | 128 | <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
|
---|
[305e60de] | 129 |
|
---|
[1ae11c9] | 130 | <screen role="root"><userinput>make docdir=/usr/share/doc/stunnel-&stunnel-version; install</userinput></screen>
|
---|
[305e60de] | 131 |
|
---|
[d3469f0] | 132 | </sect2>
|
---|
[2a7d6c3e] | 133 |
|
---|
[d3469f0] | 134 | <sect2 role="commands">
|
---|
| 135 | <title>Command Explanations</title>
|
---|
[2a7d6c3e] | 136 |
|
---|
[d3469f0] | 137 | <para><parameter>--sysconfdir=/etc</parameter>: This parameter forces
|
---|
| 138 | the configuration directory to <filename class='directory'>/etc</filename>
|
---|
| 139 | instead of <filename class='directory'>/usr/etc</filename>.</para>
|
---|
[2a7d6c3e] | 140 |
|
---|
[30ca77d2] | 141 | <para><parameter>--localstatedir=/var</parameter>: This parameter
|
---|
[ab47e379] | 142 | sets the installation to use
|
---|
[d3469f0] | 143 | <filename class='directory'>/var/lib/stunnel</filename> instead of
|
---|
[ab47e379] | 144 | creating and using
|
---|
[d3469f0] | 145 | <filename class='directory'>/usr/var/stunnel</filename>.</para>
|
---|
[2a7d6c3e] | 146 |
|
---|
[a49d0f2d] | 147 | <para><parameter>--disable-libwrap</parameter>: This parameter is required
|
---|
| 148 | if you don't have <application>tcpwrappers</application> installed. Remove
|
---|
| 149 | the parameter if <application>tcpwrappers</application> is installed.</para>
|
---|
| 150 |
|
---|
[1ae11c9] | 151 | <para><command>make docdir=... install</command>: This command installs the
|
---|
| 152 | package, changes the documentation installation directory to standard
|
---|
| 153 | naming conventions and, if you did not copy an
|
---|
| 154 | <filename>stunnel.pem</filename> file to the
|
---|
[d3469f0] | 155 | <filename class='directory'>/etc/stunnel</filename> directory, prompts you
|
---|
| 156 | for the necessary information to create one. Ensure you reply to the</para>
|
---|
[0ef1837] | 157 |
|
---|
[d3469f0] | 158 | <screen><prompt>Common Name (FQDN of your server) [localhost]:</prompt></screen>
|
---|
[2a7d6c3e] | 159 |
|
---|
[d3469f0] | 160 | <para>prompt with the name or IP address you will be using
|
---|
[50d61ed] | 161 | to access the service(s).</para>
|
---|
[2a7d6c3e] | 162 |
|
---|
[d3469f0] | 163 | </sect2>
|
---|
[2a7d6c3e] | 164 |
|
---|
[d3469f0] | 165 | <sect2 role="configuration">
|
---|
[436c2f7e] | 166 | <title>Configuring stunnel</title>
|
---|
[2a7d6c3e] | 167 |
|
---|
[d3469f0] | 168 | <sect3 id="stunnel-config">
|
---|
| 169 | <title>Config Files</title>
|
---|
[2a7d6c3e] | 170 |
|
---|
[d3469f0] | 171 | <para><filename>/etc/stunnel/stunnel.conf</filename></para>
|
---|
[2a7d6c3e] | 172 |
|
---|
[d3469f0] | 173 | <indexterm zone="stunnel stunnel-config">
|
---|
| 174 | <primary sortas="e-etc-stunnel-stunnel.conf">/etc/stunnel/stunnel.conf</primary>
|
---|
| 175 | </indexterm>
|
---|
[2a7d6c3e] | 176 |
|
---|
[d3469f0] | 177 | </sect3>
|
---|
[2a7d6c3e] | 178 |
|
---|
[d3469f0] | 179 | <sect3>
|
---|
| 180 | <title>Configuration Information</title>
|
---|
| 181 |
|
---|
[1ae11c9] | 182 | <para>As the <systemitem class="username">root</systemitem> user,
|
---|
| 183 | create the directory used for the
|
---|
| 184 | <filename class='extension'>.pid</filename> file that is created
|
---|
[436c2f7e] | 185 | when the <application>stunnel</application> daemon starts:</para>
|
---|
[1ae11c9] | 186 |
|
---|
| 187 | <screen role="root"><userinput>install -v -m750 -o stunnel -g stunnel -d /var/lib/stunnel/run</userinput></screen>
|
---|
| 188 |
|
---|
| 189 | <para>Next, create a basic <filename>/etc/stunnel/stunnel.conf</filename>
|
---|
| 190 | configuration file using the following commands as the
|
---|
| 191 | <systemitem class="username">root</systemitem> user:</para>
|
---|
[d3469f0] | 192 |
|
---|
[708f97e9] | 193 | <screen role="root"><userinput>cat >/etc/stunnel/stunnel.conf << "EOF" &&
|
---|
[1ae11c9] | 194 | <literal>; File: /etc/stunnel/stunnel.conf
|
---|
[2a7d6c3e] | 195 |
|
---|
[1ae11c9] | 196 | pid = /run/stunnel.pid
|
---|
[2a7d6c3e] | 197 | chroot = /var/lib/stunnel
|
---|
| 198 | client = no
|
---|
| 199 | setuid = stunnel
|
---|
[30ca77d2] | 200 | setgid = stunnel
|
---|
| 201 | cert = /etc/stunnel/stunnel.pem</literal>
|
---|
[2a7d6c3e] | 202 |
|
---|
[708f97e9] | 203 | EOF
|
---|
| 204 | chmod -v 644 /etc/stunnel/stunnel.conf</userinput></screen>
|
---|
[2a7d6c3e] | 205 |
|
---|
[1ae11c9] | 206 | <para>Finally, you need to add the service(s) you wish to encrypt to the
|
---|
| 207 | configuration file. The format is as follows:</para>
|
---|
[2a7d6c3e] | 208 |
|
---|
[3597eb6] | 209 | <screen><literal>[<replaceable><service></replaceable>]
|
---|
| 210 | accept = <replaceable><hostname:portnumber></replaceable>
|
---|
| 211 | connect = <replaceable><hostname:portnumber></replaceable></literal></screen>
|
---|
[d3469f0] | 212 |
|
---|
[436c2f7e] | 213 | <para>If you use <application>stunnel</application> to encrypt a daemon
|
---|
[d3469f0] | 214 | started from <command>[x]inetd</command>, you may need to disable that
|
---|
| 215 | daemon in the <filename>/etc/[x]inetd.conf</filename> file and enable a
|
---|
[3597eb6] | 216 | corresponding <replaceable><service></replaceable>_stunnel service. You
|
---|
[d3469f0] | 217 | may have to add an appropriate entry in <filename>/etc/services</filename>
|
---|
| 218 | as well.</para>
|
---|
| 219 |
|
---|
| 220 | <para>For a full explanation of the commands and syntax used in the
|
---|
| 221 | configuration file, run <command>man stunnel</command>. To see a
|
---|
| 222 | BLFS example of an actual setup of an <command>stunnel</command> encrypted
|
---|
[45f56ac] | 223 | service, read the <xref linkend="samba-swat-config"/> in the
|
---|
[d3469f0] | 224 | <application>Samba</application> instructions.</para>
|
---|
| 225 |
|
---|
| 226 | </sect3>
|
---|
| 227 |
|
---|
| 228 | <sect3 id="stunnel-init">
|
---|
| 229 | <title>Boot Script</title>
|
---|
| 230 |
|
---|
| 231 | <para>To automatically start the <command>stunnel</command> daemon
|
---|
| 232 | when the system is rebooted, install the
|
---|
| 233 | <filename>/etc/rc.d/init.d/stunnel</filename> bootscript from the
|
---|
[5254d12] | 234 | <xref linkend="bootscripts"/> package.</para>
|
---|
[d3469f0] | 235 |
|
---|
| 236 | <indexterm zone="stunnel stunnel-init">
|
---|
| 237 | <primary sortas="f-stunnel">stunnel</primary>
|
---|
| 238 | </indexterm>
|
---|
| 239 |
|
---|
| 240 | <screen role="root"><userinput>make install-stunnel</userinput></screen>
|
---|
| 241 |
|
---|
| 242 | </sect3>
|
---|
| 243 |
|
---|
| 244 | </sect2>
|
---|
| 245 |
|
---|
| 246 | <sect2 role="content">
|
---|
| 247 | <title>Contents</title>
|
---|
| 248 |
|
---|
| 249 | <segmentedlist>
|
---|
| 250 | <segtitle>Installed Programs</segtitle>
|
---|
| 251 | <segtitle>Installed Library</segtitle>
|
---|
| 252 | <segtitle>Installed Directories</segtitle>
|
---|
| 253 |
|
---|
| 254 | <seglistitem>
|
---|
| 255 | <seg>stunnel and stunnel3</seg>
|
---|
| 256 | <seg>libstunnel.so</seg>
|
---|
[1ae11c9] | 257 | <seg>/etc/stunnel, /usr/lib/stunnel,
|
---|
[2955093] | 258 | /usr/share/doc/stunnel-&stunnel-version;, and
|
---|
[1ae11c9] | 259 | /var/lib/stunnel</seg>
|
---|
[d3469f0] | 260 | </seglistitem>
|
---|
| 261 | </segmentedlist>
|
---|
| 262 |
|
---|
| 263 | <variablelist>
|
---|
| 264 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 265 | <?dbfo list-presentation="list"?>
|
---|
[869b15ae] | 266 | <?dbhtml list-presentation="table"?>
|
---|
[d3469f0] | 267 |
|
---|
| 268 | <varlistentry id="stunnel-prog">
|
---|
| 269 | <term><command>stunnel</command></term>
|
---|
| 270 | <listitem>
|
---|
| 271 | <para> is a program designed to work as an SSL
|
---|
| 272 | encryption wrapper between remote clients and local
|
---|
[3597eb6] | 273 | (<command>{x}inetd</command>-startable) or remote servers.</para>
|
---|
[d3469f0] | 274 | <indexterm zone="stunnel stunnel-prog">
|
---|
| 275 | <primary sortas="b-stunnel">stunnel</primary>
|
---|
| 276 | </indexterm>
|
---|
| 277 | </listitem>
|
---|
| 278 | </varlistentry>
|
---|
| 279 |
|
---|
| 280 | <varlistentry id="stunnel3">
|
---|
| 281 | <term><command>stunnel3</command></term>
|
---|
| 282 | <listitem>
|
---|
| 283 | <para>is a <application>Perl</application> wrapper script to use
|
---|
| 284 | <command>stunnel</command> 3.x syntax with <command>stunnel</command>
|
---|
| 285 | >=4.05.</para>
|
---|
| 286 | <indexterm zone="stunnel stunnel3">
|
---|
| 287 | <primary sortas="b-stunnel3">stunnel3</primary>
|
---|
| 288 | </indexterm>
|
---|
| 289 | </listitem>
|
---|
| 290 | </varlistentry>
|
---|
| 291 |
|
---|
| 292 | <varlistentry id="libstunnel">
|
---|
| 293 | <term><filename class='libraryfile'>libstunnel.so</filename></term>
|
---|
| 294 | <listitem>
|
---|
| 295 | <para> contains the API functions required by
|
---|
[436c2f7e] | 296 | <application>stunnel</application>.</para>
|
---|
[d3469f0] | 297 | <indexterm zone="stunnel libstunnel">
|
---|
| 298 | <primary sortas="c-libstunnel">libstunnel.so</primary>
|
---|
| 299 | </indexterm>
|
---|
| 300 | </listitem>
|
---|
| 301 | </varlistentry>
|
---|
| 302 |
|
---|
| 303 | </variablelist>
|
---|
| 304 |
|
---|
| 305 | </sect2>
|
---|
[2a7d6c3e] | 306 |
|
---|
| 307 | </sect1>
|
---|